Previous 199869 Revisions Next

r34138 Thursday 1st January, 2015 at 14:02:21 UTC by Oliver Stöneberg
"fixed" uninitialized memory usage/data race in osd_work_item_wait (nw)

appears to be a Linux-only issue
[src/osd/sdl]sdlwork.c
[src/osd/windows]winwork.c

trunk/src/osd/sdl/sdlwork.c
r242649r242650
428428            return NULL;
429429         item->event = NULL;
430430         item->queue = queue;
431         item->done = FALSE;
431432      }
433      else
434      {
435         atomic_exchange32(&item->done, FALSE); // needs to be set this way to prevent data race/usage of uninitialized memory on Linux
436      }
432437
433438      // fill in the basics
434439      item->next = NULL;
r242649r242650
436441      item->param = parambase;
437442      item->result = NULL;
438443      item->flags = flags;
439      atomic_exchange32(&item->done, FALSE);
440444
441445      // advance to the next
442446      lastitem = item;
trunk/src/osd/windows/winwork.c
r242649r242650
438438            return NULL;
439439         item->event = NULL;
440440         item->queue = queue;
441         item->done = FALSE;
441442      }
443      else
444      {
445         atomic_exchange32(&item->done, FALSE); // needs to be set this way to prevent data race/usage of uninitialized memory on Linux
446      }
442447
443448      // fill in the basics
444449      item->next = NULL;
445450      item->callback = callback;
446451      item->param = parambase;
447452      item->result = NULL;
448      item->flags = flags;
449      atomic_exchange32(&item->done, FALSE);
453      item->flags = flags;     
450454
451455      // advance to the next
452456      lastitem = item;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team