Mutex Win32 Implementation Flaw
Brought to you by:
kspes
The _WIN32 path for TheoraMutex::lock() does a conservative creation of the Win32 Mutex object (only create it if not created before). This code is not multi-threading safe. If two threads call onto the new mutex object right at the same time, they will both cause the object to create the Win32 mutex and they won't block on one another. A better way to do it is to simply create the Win32 mutex object in the mutex constructor (at which time it is not expected to be used yet), and the lock() function simply waits on the mutex.
Best!
Hmm, good point! I'll fix it, thanks for pointing it out!