fix a bug in thread pool impl.