fix race condition in orderedThreadPool