diff options
| author | 2015-01-28 09:20:10 +0100 | |
|---|---|---|
| committer | 2015-01-28 09:20:10 +0100 | |
| commit | 26e7a17b6326aa5a75a6276e52cf84a94c16d7a0 (patch) | |
| tree | bab4468226c59d590688e0ece892f5bfbca58736 /src/osd/modules/sync/work_osd.c | |
| parent | 13b862c4fae88f0f819c2c4416d49249e4de45b9 (diff) | |
Cleanups and version bumpmame0158
Diffstat (limited to 'src/osd/modules/sync/work_osd.c')
| -rw-r--r-- | src/osd/modules/sync/work_osd.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/osd/modules/sync/work_osd.c b/src/osd/modules/sync/work_osd.c index 6c080b5a2ed..89dec09b122 100644 --- a/src/osd/modules/sync/work_osd.c +++ b/src/osd/modules/sync/work_osd.c @@ -70,22 +70,22 @@ typedef void *PVOID; template<typename _PtrType> static void spin_while(const volatile _PtrType * volatile ptr, const _PtrType val, const osd_ticks_t timeout, const int invert = 0) { - osd_ticks_t stopspin = osd_ticks() + timeout; - - do { - int spin = 10000; - while (--spin) - { - if ((*ptr != val) ^ invert) - return; - } - } while (((*ptr == val) ^ invert) && osd_ticks() < stopspin); + osd_ticks_t stopspin = osd_ticks() + timeout; + + do { + int spin = 10000; + while (--spin) + { + if ((*ptr != val) ^ invert) + return; + } + } while (((*ptr == val) ^ invert) && osd_ticks() < stopspin); } template<typename _PtrType> static void spin_while_not(const volatile _PtrType * volatile ptr, const _PtrType val, const osd_ticks_t timeout) { - spin_while(ptr, val, timeout, 1); + spin_while(ptr, val, timeout, 1); } @@ -553,7 +553,7 @@ int osd_work_item_wait(osd_work_item *item, osd_ticks_t timeout) if (item->event == NULL) { // TODO: do we need to measure the spin time here as well? and how can we do it? - spin_while(&item->done, 0, timeout); + spin_while(&item->done, 0, timeout); } // otherwise, block on the event until done |
