#include <SXLock.h>
XXX/bowei -- convert this to use atomic instructions directly
Definition at line 33 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 45 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 57 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 68 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 87 of file SXLock.h.
References oasys::Lock::lock(), lock_, oasys::Lock::unlock(), and xcount_.
Lock* oasys::SXLock::lock_ [private] |
Definition at line 101 of file SXLock.h.
Referenced by exclusive_lock(), exclusive_unlock(), shared_lock(), and shared_unlock().
int oasys::SXLock::scount_ [private] |
Definition at line 103 of file SXLock.h.
Referenced by exclusive_lock(), shared_lock(), and shared_unlock().
int oasys::SXLock::xcount_ [private] |
Definition at line 104 of file SXLock.h.
Referenced by exclusive_lock(), exclusive_unlock(), and shared_lock().