fixed threadpool race cond