is CreateThread(CREATE_SUSPENDED) fully functional?
madewokherd at gmail.com
Thu Sep 27 10:15:34 CDT 2012
I'm pretty sure CREATE_SUSPENDED works. It's such a basic thing that
would cause many race conditions if it did not, including in parts of
Wine that use it and in the test you just linked.
If the new thread were not initially suspended, it would be possible
for the thread to return between the initial CreateThread call and the
following SuspendThread call. This would cause the first
WaitForSingleObject to succeed and the test to fail.
I guess you could change the test to include a wait before the first
SuspendThread call, but given that there probably aren't any broken
implementations that this would specifically catch (and those
implementations would already fail sometimes), I don't see the point.
More information about the wine-devel