Commit 0a8f685b authored by Simon Marlow's avatar Simon Marlow

rename spin lock functions, and use macros for non-THREADED_RTS

parent cb3cb473
...@@ -233,7 +233,7 @@ typedef lnat StgSyncCount; ...@@ -233,7 +233,7 @@ typedef lnat StgSyncCount;
// spin locks to check for contention. // spin locks to check for contention.
// acquire spin lock // acquire spin lock
INLINE_HEADER void acquireSpinLock(StgSync * p) INLINE_HEADER void ACQUIRE_SPIN_LOCK(StgSync * p)
{ {
StgWord32 r = 0; StgWord32 r = 0;
do { do {
...@@ -244,7 +244,7 @@ INLINE_HEADER void acquireSpinLock(StgSync * p) ...@@ -244,7 +244,7 @@ INLINE_HEADER void acquireSpinLock(StgSync * p)
} }
// release spin lock // release spin lock
INLINE_HEADER void releaseSpinLock(StgSync * p) INLINE_HEADER void RELEASE_SPIN_LOCK(StgSync * p)
{ {
write_barrier(); write_barrier();
p->lock = 1; p->lock = 1;
...@@ -261,7 +261,7 @@ INLINE_HEADER void initSpinLock(StgSync * p) ...@@ -261,7 +261,7 @@ INLINE_HEADER void initSpinLock(StgSync * p)
#else #else
// acquire spin lock // acquire spin lock
INLINE_HEADER void acquireSpinLock(StgSync * p) INLINE_HEADER void ACQUIRE_SPIN_LOCK(StgSync * p)
{ {
StgWord32 r = 0; StgWord32 r = 0;
do { do {
...@@ -270,7 +270,7 @@ INLINE_HEADER void acquireSpinLock(StgSync * p) ...@@ -270,7 +270,7 @@ INLINE_HEADER void acquireSpinLock(StgSync * p)
} }
// release spin lock // release spin lock
INLINE_HEADER void releaseSpinLock(StgSync * p) INLINE_HEADER void RELEASE_SPIN_LOCK(StgSync * p)
{ {
write_barrier(); write_barrier();
(*p) = 1; (*p) = 1;
...@@ -306,11 +306,9 @@ INLINE_HEADER void ...@@ -306,11 +306,9 @@ INLINE_HEADER void
unlockClosure(StgClosure *p STG_UNUSED, StgInfoTable *info STG_UNUSED) unlockClosure(StgClosure *p STG_UNUSED, StgInfoTable *info STG_UNUSED)
{ /* nothing */ } { /* nothing */ }
INLINE_HEADER void acquireSpinLock(void * p STG_UNUSED) // Using macros here means we don't have to ensure the argument is in scope
{ /* nothing */ } #define ACQUIRE_SPIN_LOCK(p) /* nothing */
#define RELEASE_SPIN_LOCK(p) /* nothing */
INLINE_HEADER void releaseSpinLock(void * p STG_UNUSED)
{ /* nothing */ }
INLINE_HEADER void initSpinLock(void * p STG_UNUSED) INLINE_HEADER void initSpinLock(void * p STG_UNUSED)
{ /* nothing */ } { /* nothing */ }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment