ntdll: Make RtlDeregisterWaitEx(handle, INVALID_HANDLE_VALUE) thread safe.
commitaf35aada9b078f8dc71dcc85e505da8eee4571da
authorStefan Dösinger <stefan@codeweavers.com>
Tue, 5 Sep 2017 15:34:03 +0000 (5 17:34 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 6 Sep 2017 18:32:07 +0000 (6 20:32 +0200)
treef46ffd673b095f4fb2a167e704ea6639c7ca73e4
parent41236123bbcf0c3065fb528ebe82831357023fac
ntdll: Make RtlDeregisterWaitEx(handle, INVALID_HANDLE_VALUE) thread safe.

Chromium signals the wait semaphore and calls DeregisterWaitEx with
CompletionHandle = INVALID_HANDLE_VALUE in close succession. Sometimes
the worker thread decides to run the callback, but before it sets
CallbackInProgress RtlDeregisterWaitEx decides that the callback is not
running and returns STATUS_SUCCESS. Chromium then releases resources
that the callback needs to run, resulting in random crashes.

Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
dlls/ntdll/threadpool.c