Am 27.09.2012 09:13, schrieb Joerg-Cyril.Hoehle@t-systems.com:
Hi,
Recently I thought I found a use-case for CreateThread(CREATE_SUSPENDED). The idiom is to get the thread handle before the thread starts a life on its own.
I looked at the kernel tests, http://source.winehq.org/source/dlls/kernel32/tests/thread.c#L460
However, both invocations with CREATE_SUSPENDED actually test the pair CreateThread + SuspendThread. The tests do not prove that CREATE_SUSPENDED works! They only prove that the suspend counter and perhaps SuspendThread work.
a) Does Wine not support CREATE_SUSPENDED, so that the tests do the best they can? In such a case, a WARN("ignoring SUSPENDED flag, beware of race conditions\n") would be appropriate.
or b) CREATE_SUSPENDED is fully supported on all platforms. Then the tests need some refinement.
Why did you only had a look at the tests? I checked the source in 30 seconds and answered the question for me: CREATE_SUSPENDED is an essential part of the CreateThread Implementation. Anyway, more tests are always welcome.