http://bugs.winehq.org/show_bug.cgi?id=33125
--- Comment #75 from Felix Hädicke felixhaedicke@web.de 2013-04-10 15:50:25 CDT --- @thanoulas Your description confuses me a little. Have you used clang (3.2) or GCC (4.8) - these are different compilers - also for dlls/kernel32/sync.c and the rest, or did you just use clang for winemac.drv?
I tried to compile only the unmodified dlls/kernel32/sync.c with clang 3.0 instead of GCC (the rest of Wine with GCC 4.7.2) with -O1 and again with -O3 and the game did not freeze.
Another thing I tried was to compile Wine without optimizations, only dlls/kernel32/sync.c with optimization turned on. The bug was still there. Then I turned on optimization only for CreateEventExW and the game did not freeze as I had expected.
What I found out in my further investigations is that enabling optimizations (-O1 is enough) for the following thre functions only (and not for all the rest of Wine) makes the bug occur: * CreateEventExW * CreateSemaphoreW * CreateSemaphoreExW And if optimization is disabled for only one of these three functions, the freeze is gone.