Just do what i do, use SDL. it's semaphores and mutexes work perfectly fine when used with Tthread.