summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/winwork.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/windows/winwork.c')
-rw-r--r--src/osd/windows/winwork.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/osd/windows/winwork.c b/src/osd/windows/winwork.c
index 6f3927585fd..97162fdaa23 100644
--- a/src/osd/windows/winwork.c
+++ b/src/osd/windows/winwork.c
@@ -438,6 +438,11 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call
return NULL;
item->event = NULL;
item->queue = queue;
+ item->done = FALSE;
+ }
+ else
+ {
+ atomic_exchange32(&item->done, FALSE); // needs to be set this way to prevent data race/usage of uninitialized memory on Linux
}
// fill in the basics
@@ -445,8 +450,7 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call
item->callback = callback;
item->param = parambase;
item->result = NULL;
- item->flags = flags;
- atomic_exchange32(&item->done, FALSE);
+ item->flags = flags;
// advance to the next
lastitem = item;