mmdevapi: Prevent race condition upon Start.

Alexandre Julliard julliard at
Tue Dec 18 06:00:43 CST 2012

<Joerg-Cyril.Hoehle at> writes:

> What happened every so often, even on a single-core machine(!), is
> that CreateTimerQueue(dueTime=0=immediate) would see the timer thread
> created and the callback invoked before the function returns.  Since
> This->started was not set yet, our callback would return immediately,
> in effect causing sound to start only one 10ms period later.
> That's obviously was not intended by the author.
> So let's set This->started before CTQ.

This doesn't make sense, there's a critical section.

Alexandre Julliard
julliard at

More information about the wine-devel mailing list