I still don't understand how/why it deadlocks w/o the sleep and how sleep affects it. With my change, the new thread must be calling the user thread function when pthread_create returns. So basically the new thread is already running from tsan point in view. http://reviews.llvm.org/D6504