pthread_cond_timedwait for Windows
TLS variable is also required for the master thread