mirror of
https://github.com/holub/mame
synced 2025-05-14 18:08:13 +03:00
"fixed" uninitialized memory usage/data race in osd_work_item_wait (nw)
appears to be a Linux-only issue
This commit is contained in:
parent
5d5a89726c
commit
0c0260ec2d
@ -428,6 +428,11 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call
|
|||||||
return NULL;
|
return NULL;
|
||||||
item->event = NULL;
|
item->event = NULL;
|
||||||
item->queue = queue;
|
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
|
// fill in the basics
|
||||||
@ -436,7 +441,6 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call
|
|||||||
item->param = parambase;
|
item->param = parambase;
|
||||||
item->result = NULL;
|
item->result = NULL;
|
||||||
item->flags = flags;
|
item->flags = flags;
|
||||||
atomic_exchange32(&item->done, FALSE);
|
|
||||||
|
|
||||||
// advance to the next
|
// advance to the next
|
||||||
lastitem = item;
|
lastitem = item;
|
||||||
|
@ -438,6 +438,11 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call
|
|||||||
return NULL;
|
return NULL;
|
||||||
item->event = NULL;
|
item->event = NULL;
|
||||||
item->queue = queue;
|
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
|
// fill in the basics
|
||||||
@ -446,7 +451,6 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call
|
|||||||
item->param = parambase;
|
item->param = parambase;
|
||||||
item->result = NULL;
|
item->result = NULL;
|
||||||
item->flags = flags;
|
item->flags = flags;
|
||||||
atomic_exchange32(&item->done, FALSE);
|
|
||||||
|
|
||||||
// advance to the next
|
// advance to the next
|
||||||
lastitem = item;
|
lastitem = item;
|
||||||
|
Loading…
Reference in New Issue
Block a user