mirror of
https://github.com/holub/mame
synced 2025-05-16 19:00:43 +03:00
fixed yet another data race warning (nw)
This commit is contained in:
parent
0c0260ec2d
commit
ab2876ab12
@ -690,14 +690,20 @@ static void worker_thread_process(osd_work_queue *queue, work_thread_info *threa
|
||||
begin_timing(thread->runtime);
|
||||
|
||||
// loop until everything is processed
|
||||
while (queue->list != NULL)
|
||||
while (true)
|
||||
{
|
||||
osd_work_item *item;
|
||||
INT32 lockslot;
|
||||
|
||||
// use a critical section to synchronize the removal of items
|
||||
lockslot = osd_scalable_lock_acquire(queue->lock);
|
||||
INT32 lockslot = osd_scalable_lock_acquire(queue->lock);
|
||||
{
|
||||
if (queue->list == NULL)
|
||||
{
|
||||
osd_scalable_lock_release(queue->lock, lockslot);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// pull the item from the queue
|
||||
item = (osd_work_item *)queue->list;
|
||||
if (item != NULL)
|
||||
|
@ -681,14 +681,20 @@ static void worker_thread_process(osd_work_queue *queue, work_thread_info *threa
|
||||
begin_timing(thread->runtime);
|
||||
|
||||
// loop until everything is processed
|
||||
while (queue->list != NULL)
|
||||
while (true)
|
||||
{
|
||||
osd_work_item *item;
|
||||
INT32 lockslot;
|
||||
|
||||
// use a critical section to synchronize the removal of items
|
||||
lockslot = osd_scalable_lock_acquire(queue->lock);
|
||||
INT32 lockslot = osd_scalable_lock_acquire(queue->lock);
|
||||
{
|
||||
if (queue->list == NULL)
|
||||
{
|
||||
osd_scalable_lock_release(queue->lock, lockslot);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// pull the item from the queue
|
||||
item = (osd_work_item *)queue->list;
|
||||
if (item != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user