void Win32SyncManager::ThreadBegin(Semaphore sem){ sem.Down(); OnWakeup(); TlsSetValue(tlsCurrentTaskId, (LPVOID)runningTid); Chess::TaskBegin(); #ifndef UNDER_CE //A thread starts in an alertable state (i.e. Executes APCs that are queued before starting) WrappersOnAlertableState(runningTid); #endif }