winmm: Fix race condition between timeKillEvent and function triggering

Maarten Lankhorst m.b.lankhorst at
Fri Jun 8 14:17:52 CDT 2007

This fixes the following race for TIME_KILL_SYNCHRONOUS:

MMSysTimeCallback acquires winmm lock, copies struct, leaves winmm lock.

timeKillEvent acquires winmm lock, enters TIME_cbcrst lock, free's timer
and returns.

MMSysTimeCallback calls the function after timeKillEvent has been
called, while the application is safe to return that doesn't happen any
more, and it might have free'd some stuff in the mean time.

Solution: Enter TIME_cbcrst in mmsystimecallback BEFORE leaving winmm lock.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmm.patch
Type: text/x-patch
Size: 454 bytes
Desc: not available
Url :

More information about the wine-patches mailing list