diff options
author | Simon Marlow <simonmar@microsoft.com> | 2006-10-26 09:18:14 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2006-10-26 09:18:14 +0000 |
commit | 0a8f685b4c66093df7732c6b92a631cf4c84c05d (patch) | |
tree | 7bae425a310090a1975022387ad549e882501b7f /includes/SMP.h | |
parent | cb3cb473854e815784375ad23cc5081621a95ce8 (diff) | |
download | haskell-0a8f685b4c66093df7732c6b92a631cf4c84c05d.tar.gz |
rename spin lock functions, and use macros for non-THREADED_RTS
Diffstat (limited to 'includes/SMP.h')
-rw-r--r-- | includes/SMP.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/includes/SMP.h b/includes/SMP.h index 04e4d1326b..b410c6eb47 100644 --- a/includes/SMP.h +++ b/includes/SMP.h @@ -233,7 +233,7 @@ typedef lnat StgSyncCount; // spin locks to check for contention. // acquire spin lock -INLINE_HEADER void acquireSpinLock(StgSync * p) +INLINE_HEADER void ACQUIRE_SPIN_LOCK(StgSync * p) { StgWord32 r = 0; do { @@ -244,7 +244,7 @@ INLINE_HEADER void acquireSpinLock(StgSync * p) } // release spin lock -INLINE_HEADER void releaseSpinLock(StgSync * p) +INLINE_HEADER void RELEASE_SPIN_LOCK(StgSync * p) { write_barrier(); p->lock = 1; @@ -261,7 +261,7 @@ INLINE_HEADER void initSpinLock(StgSync * p) #else // acquire spin lock -INLINE_HEADER void acquireSpinLock(StgSync * p) +INLINE_HEADER void ACQUIRE_SPIN_LOCK(StgSync * p) { StgWord32 r = 0; do { @@ -270,7 +270,7 @@ INLINE_HEADER void acquireSpinLock(StgSync * p) } // release spin lock -INLINE_HEADER void releaseSpinLock(StgSync * p) +INLINE_HEADER void RELEASE_SPIN_LOCK(StgSync * p) { write_barrier(); (*p) = 1; @@ -306,11 +306,9 @@ INLINE_HEADER void unlockClosure(StgClosure *p STG_UNUSED, StgInfoTable *info STG_UNUSED) { /* nothing */ } -INLINE_HEADER void acquireSpinLock(void * p STG_UNUSED) -{ /* nothing */ } - -INLINE_HEADER void releaseSpinLock(void * p STG_UNUSED) -{ /* nothing */ } +// Using macros here means we don't have to ensure the argument is in scope +#define ACQUIRE_SPIN_LOCK(p) /* nothing */ +#define RELEASE_SPIN_LOCK(p) /* nothing */ INLINE_HEADER void initSpinLock(void * p STG_UNUSED) { /* nothing */ } |