If you remove that pair of lock/unlock, it seems that the atomic_inc(&pw->numRunning); should be moved to poolworker_main if we want to keep a correct accounting of the number of threads that have started.