Module: wine Branch: master Commit: 5fa6014567a95e7a9f4c5b2759ba60b12feb254a URL: https://gitlab.winehq.org/wine/wine/-/commit/5fa6014567a95e7a9f4c5b2759ba60b...
Author: Piotr Caban piotr@codeweavers.com Date: Sun Oct 1 11:00:53 2023 +0200
msvcr110: Reset chore task_collection earlier to prevent occasional test failure.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55686
---
dlls/msvcrt/concurrency.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index fa21a206e79..2af2f3ff917 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -2241,20 +2241,19 @@ static void execute_chore(_UnrealizedChore *chore, static void CALLBACK chore_wrapper_finally(BOOL normal, void *data) { _UnrealizedChore *chore = data; - volatile LONG *ptr; + struct _StructuredTaskCollection *task_collection = chore->task_collection; LONG finished = 1;
TRACE("(%u %p)\n", normal, data);
- if (!chore->task_collection) + if (!task_collection) return; - ptr = &chore->task_collection->finished; + chore->task_collection = NULL;
- if (InterlockedCompareExchange(ptr, 1, FINISHED_INITIAL) != FINISHED_INITIAL) - finished = InterlockedIncrement(ptr); + if (InterlockedCompareExchange(&task_collection->finished, 1, FINISHED_INITIAL) != FINISHED_INITIAL) + finished = InterlockedIncrement(&task_collection->finished); if (!finished) - call_Context_Unblock(chore->task_collection->event); - chore->task_collection = NULL; + call_Context_Unblock(task_collection->event); }
static void __cdecl chore_wrapper(_UnrealizedChore *chore)