#include <SXLock.h>
XXX/bowei -- convert this to use atomic instructions directly
Definition at line 17 of file SXLock.h.
Public Member Functions | |
SXLock (Lock *lock) | |
void | shared_lock () |
void | shared_unlock () |
Drop the shared lock. | |
void | exclusive_lock () |
void | exclusive_unlock () |
Drop the write lock. | |
Private Attributes | |
Lock * | lock_ |
int | scount_ |
int | xcount_ |
void oasys::SXLock::shared_lock | ( | ) | [inline] |
Acquire a shared lock. Any number of readers are permitted inside a shared lock.
Definition at line 29 of file SXLock.h.
References oasys::Lock::lock(), lock_, scount_, oasys::Thread::spin_yield(), oasys::Lock::unlock(), and xcount_.
void oasys::SXLock::shared_unlock | ( | ) | [inline] |
Drop the shared lock.
Definition at line 41 of file SXLock.h.
References oasys::Lock::lock(), lock_, scount_, and oasys::Lock::unlock().
void oasys::SXLock::exclusive_lock | ( | ) | [inline] |
Acquire the write lock. Only one writer is permitted to hold the write lock. No readers are allowed inside when the write lock is held.
Definition at line 52 of file SXLock.h.
References oasys::Lock::lock(), lock_, scount_, oasys::Thread::spin_yield(), oasys::Lock::unlock(), and xcount_.
void oasys::SXLock::exclusive_unlock | ( | ) | [inline] |
Drop the write lock.
Definition at line 71 of file SXLock.h.
References oasys::Lock::lock(), lock_, oasys::Lock::unlock(), and xcount_.
Lock* oasys::SXLock::lock_ [private] |
Definition at line 85 of file SXLock.h.
Referenced by exclusive_lock(), exclusive_unlock(), shared_lock(), and shared_unlock().
int oasys::SXLock::scount_ [private] |
Definition at line 87 of file SXLock.h.
Referenced by exclusive_lock(), shared_lock(), and shared_unlock().
int oasys::SXLock::xcount_ [private] |
Definition at line 88 of file SXLock.h.
Referenced by exclusive_lock(), exclusive_unlock(), and shared_lock().