Commit 5fa60145 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcr110: Reset chore task_collection earlier to prevent occasional test failure.

parent 450c3588
...@@ -2241,20 +2241,19 @@ static void execute_chore(_UnrealizedChore *chore, ...@@ -2241,20 +2241,19 @@ static void execute_chore(_UnrealizedChore *chore,
static void CALLBACK chore_wrapper_finally(BOOL normal, void *data) static void CALLBACK chore_wrapper_finally(BOOL normal, void *data)
{ {
_UnrealizedChore *chore = data; _UnrealizedChore *chore = data;
volatile LONG *ptr; struct _StructuredTaskCollection *task_collection = chore->task_collection;
LONG finished = 1; LONG finished = 1;
TRACE("(%u %p)\n", normal, data); TRACE("(%u %p)\n", normal, data);
if (!chore->task_collection) if (!task_collection)
return; return;
ptr = &chore->task_collection->finished; chore->task_collection = NULL;
if (InterlockedCompareExchange(ptr, 1, FINISHED_INITIAL) != FINISHED_INITIAL) if (InterlockedCompareExchange(&task_collection->finished, 1, FINISHED_INITIAL) != FINISHED_INITIAL)
finished = InterlockedIncrement(ptr); finished = InterlockedIncrement(&task_collection->finished);
if (!finished) if (!finished)
call_Context_Unblock(chore->task_collection->event); call_Context_Unblock(task_collection->event);
chore->task_collection = NULL;
} }
static void __cdecl chore_wrapper(_UnrealizedChore *chore) static void __cdecl chore_wrapper(_UnrealizedChore *chore)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment