Integrated new thread pool code