X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2Frts%2FSpinLock.h;h=3d0b56cfcbd6e2d98e88cde8159b1fbdee68e098;hb=0ee6cfbe62211121fc84a9d2e500f414f9e397f7;hp=9bfb35bbac9fa95cea1434430f0cd5178636e8bd;hpb=d20d32d788e2d6c088e6b03776c428df5bb004d3;p=ghc-hetmet.git diff --git a/includes/rts/SpinLock.h b/includes/rts/SpinLock.h index 9bfb35b..3d0b56c 100644 --- a/includes/rts/SpinLock.h +++ b/includes/rts/SpinLock.h @@ -49,6 +49,7 @@ spin: r = cas((StgVolatilePtr)&(p->lock), 1, 0); if (r == 0) { p->spin++; + busy_wait_nop(); goto spin; } } @@ -76,6 +77,7 @@ INLINE_HEADER void ACQUIRE_SPIN_LOCK(SpinLock * p) StgWord32 r = 0; do { r = cas((StgVolatilePtr)p, 1, 0); + busy_wait_nop(); } while(r == 0); }