diff options
| author | Jeff Roberson <jeff@FreeBSD.org> | 2003-03-26 04:02:24 +0000 |
|---|---|---|
| committer | Jeff Roberson <jeff@FreeBSD.org> | 2003-03-26 04:02:24 +0000 |
| commit | cc3521d66055ed9c5cc720613a3f0e84589a4abe (patch) | |
| tree | 23941a59360abf1f23a2109a15011a66807ae876 | |
| parent | 6410552316016c539531b28ecf9947cd4ddfb553 (diff) | |
Notes
| -rw-r--r-- | lib/libc/gen/_spinlock_stub.c | 9 | ||||
| -rw-r--r-- | lib/libc/include/spinlock.h | 3 | ||||
| -rw-r--r-- | lib/libc_r/uthread/uthread_spinlock.c | 6 | ||||
| -rw-r--r-- | lib/libkse/thread/thr_spinlock.c | 7 | ||||
| -rw-r--r-- | lib/libpthread/thread/thr_spinlock.c | 7 |
5 files changed, 31 insertions, 1 deletions
diff --git a/lib/libc/gen/_spinlock_stub.c b/lib/libc/gen/_spinlock_stub.c index e53fdb46ba96..85faf285cbe3 100644 --- a/lib/libc/gen/_spinlock_stub.c +++ b/lib/libc/gen/_spinlock_stub.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); */ __weak_reference(_atomic_lock_stub, _atomic_lock); __weak_reference(_spinlock_stub, _spinlock); +__weak_reference(_spinlock_stub, _spinunlock); __weak_reference(_spinlock_debug_stub, _spinlock_debug); @@ -65,6 +66,14 @@ _spinlock_stub(spinlock_t *lck) } /* + * This function is a stub for the spinunlock function in libpthread. + */ +void +_spinunlock_stub(spinlock_t *lck) +{ +} + +/* * This function is a stub for the debug spinlock function in libpthread. */ void diff --git a/lib/libc/include/spinlock.h b/lib/libc/include/spinlock.h index d661ecf5334d..6334253e21c8 100644 --- a/lib/libc/include/spinlock.h +++ b/lib/libc/include/spinlock.h @@ -52,7 +52,7 @@ typedef struct { #define _SPINLOCK_INITIALIZER { 0, 0, 0, 0 } -#define _SPINUNLOCK(_lck) (_lck)->access_lock = 0 +#define _SPINUNLOCK(_lck) _spinunlock(_lck); #ifdef _LOCK_DEBUG #define _SPINLOCK(_lck) _spinlock_debug(_lck, __FILE__, __LINE__) #else @@ -65,6 +65,7 @@ typedef struct { __BEGIN_DECLS long _atomic_lock(volatile long *); void _spinlock(spinlock_t *); +void _spinunlock(spinlock_t *); void _spinlock_debug(spinlock_t *, char *, int); __END_DECLS diff --git a/lib/libc_r/uthread/uthread_spinlock.c b/lib/libc_r/uthread/uthread_spinlock.c index e05aa4a5fc0b..0c8eae33ecae 100644 --- a/lib/libc_r/uthread/uthread_spinlock.c +++ b/lib/libc_r/uthread/uthread_spinlock.c @@ -44,6 +44,12 @@ #include "pthread_private.h" +void +_spinunlock(spinlock_t *lck) +{ + lck->access_lock = 0; +} + /* * Lock a location for the running thread. Yield to allow other * threads to run if this thread is blocked because the lock is diff --git a/lib/libkse/thread/thr_spinlock.c b/lib/libkse/thread/thr_spinlock.c index 544ea3cdf857..ad7b2223ef3e 100644 --- a/lib/libkse/thread/thr_spinlock.c +++ b/lib/libkse/thread/thr_spinlock.c @@ -44,6 +44,13 @@ #include "thr_private.h" +void +_spinunlock(spinlock_t *lck) +{ + lck->access_lock = 0; +} + + /* * Lock a location for the running thread. Yield to allow other * threads to run if this thread is blocked because the lock is diff --git a/lib/libpthread/thread/thr_spinlock.c b/lib/libpthread/thread/thr_spinlock.c index 544ea3cdf857..ad7b2223ef3e 100644 --- a/lib/libpthread/thread/thr_spinlock.c +++ b/lib/libpthread/thread/thr_spinlock.c @@ -44,6 +44,13 @@ #include "thr_private.h" +void +_spinunlock(spinlock_t *lck) +{ + lck->access_lock = 0; +} + + /* * Lock a location for the running thread. Yield to allow other * threads to run if this thread is blocked because the lock is |
