proxygen
|
#include <RWSpinLock.h>
Classes | |
class | ReadHolder |
class | UpgradedHolder |
class | WriteHolder |
Public Member Functions | |
constexpr | RWSpinLock () |
RWSpinLock (RWSpinLock const &)=delete | |
RWSpinLock & | operator= (RWSpinLock const &)=delete |
void | lock () |
void | unlock () |
void | lock_shared () |
void | unlock_shared () |
void | unlock_and_lock_shared () |
void | lock_upgrade () |
void | unlock_upgrade () |
void | unlock_upgrade_and_lock () |
void | unlock_upgrade_and_lock_shared () |
void | unlock_and_lock_upgrade () |
bool | try_lock () |
bool | try_lock_shared () |
bool | try_unlock_upgrade_and_lock () |
bool | try_lock_upgrade () |
int32_t | bits () const |
Private Types | |
enum | : int32_t { READER = 4, UPGRADED = 2, WRITER = 1 } |
Private Attributes | |
std::atomic< int32_t > | bits_ |
Definition at line 181 of file RWSpinLock.h.
|
private |
Enumerator | |
---|---|
READER | |
UPGRADED | |
WRITER |
Definition at line 182 of file RWSpinLock.h.
|
inline |
|
delete |
|
inline |
|
inline |
Definition at line 191 of file RWSpinLock.h.
References count, LIKELY, try_lock(), and folly::fibers::yield().
Referenced by folly::RWSpinLock::ReadHolder::reset(), folly::RWSpinLock::UpgradedHolder::reset(), folly::RWSpinLock::WriteHolder::reset(), and folly::RWSpinLock::WriteHolder::WriteHolder().
|
inline |
Definition at line 207 of file RWSpinLock.h.
References count, LIKELY, try_lock_shared(), and folly::fibers::yield().
Referenced by folly::RWSpinLock::ReadHolder::ReadHolder(), and folly::RWSpinLock::ReadHolder::reset().
|
inline |
Definition at line 227 of file RWSpinLock.h.
References count, try_lock_upgrade(), and folly::fibers::yield().
Referenced by folly::RWSpinLock::UpgradedHolder::reset(), and folly::RWSpinLock::UpgradedHolder::UpgradedHolder().
|
delete |
Referenced by RWSpinLock().
|
inline |
Definition at line 264 of file RWSpinLock.h.
References bits_, folly::symbolizer::test::expect(), int32_t, and WRITER.
Referenced by lock().
|
inline |
Definition at line 276 of file RWSpinLock.h.
References bits_, int32_t, READER, UNLIKELY, UPGRADED, folly::value(), and WRITER.
Referenced by lock_shared().
|
inline |
Definition at line 295 of file RWSpinLock.h.
References bits_, int32_t, UPGRADED, folly::value(), and WRITER.
Referenced by lock_upgrade().
|
inline |
Definition at line 288 of file RWSpinLock.h.
References bits_, folly::symbolizer::test::expect(), int32_t, UPGRADED, and WRITER.
Referenced by unlock_upgrade_and_lock().
|
inline |
Definition at line 201 of file RWSpinLock.h.
References bits_, READER, UPGRADED, and WRITER.
Referenced by folly::RWSpinLock::WriteHolder::reset(), unlock_and_lock_shared(), and folly::RWSpinLock::WriteHolder::~WriteHolder().
|
inline |
Definition at line 221 of file RWSpinLock.h.
References bits_, READER, and unlock().
Referenced by folly::RWSpinLock::ReadHolder::ReadHolder().
|
inline |
Definition at line 256 of file RWSpinLock.h.
References bits_, UPGRADED, and WRITER.
Referenced by folly::RWSpinLock::UpgradedHolder::UpgradedHolder().
|
inline |
Definition at line 216 of file RWSpinLock.h.
Referenced by folly::RWSpinLock::ReadHolder::reset(), and folly::RWSpinLock::ReadHolder::~ReadHolder().
|
inline |
Definition at line 236 of file RWSpinLock.h.
References bits_, and UPGRADED.
Referenced by folly::RWSpinLock::UpgradedHolder::reset(), and folly::RWSpinLock::UpgradedHolder::~UpgradedHolder().
|
inline |
Definition at line 241 of file RWSpinLock.h.
References count, int64_t, try_unlock_upgrade_and_lock(), and folly::fibers::yield().
Referenced by folly::RWSpinLock::WriteHolder::WriteHolder().
|
inline |
Definition at line 251 of file RWSpinLock.h.
References bits_, READER, and UPGRADED.
Referenced by folly::RWSpinLock::ReadHolder::ReadHolder().
|
private |
Definition at line 511 of file RWSpinLock.h.
Referenced by bits(), try_lock(), try_lock_shared(), try_lock_upgrade(), try_unlock_upgrade_and_lock(), unlock(), unlock_and_lock_shared(), unlock_and_lock_upgrade(), unlock_shared(), unlock_upgrade(), and unlock_upgrade_and_lock_shared().