Use critical sections as mutex on Windows They're more lightweight than ordinary Windows mutexes. Also stop counting recursive locks. This only hides potential locking bugs.