Made connection between threads and thread pool.