Update threadpool code