condition threadsafe on ENABLE_PTHREAD_SUPPORT