proxygen
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder Class Reference

#include <SharedMutex.h>

Public Member Functions

 ReadHolder (const SharedMutexImpl *lock)
 
 ReadHolder (const SharedMutexImpl &lock)
 
 ReadHolder (ReadHolder &&rhs) noexcept
 
 ReadHolder (UpgradeHolder &&upgraded)
 
 ReadHolder (WriteHolder &&writer)
 
ReadHolderoperator= (ReadHolder &&rhs) noexcept
 
 ReadHolder (const ReadHolder &rhs)=delete
 
ReadHolderoperator= (const ReadHolder &rhs)=delete
 
 ~ReadHolder ()
 
void unlock ()
 

Private Member Functions

 ReadHolder ()
 

Private Attributes

SharedMutexImpllock_
 
SharedMutexToken token_
 

Friends

class UpgradeHolder
 
class WriteHolder
 

Detailed Description

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
class folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder

Definition at line 1302 of file SharedMutex.h.

Constructor & Destructor Documentation

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::ReadHolder ( )
inlineprivate

Definition at line 1303 of file SharedMutex.h.

1303 : lock_(nullptr) {}
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::ReadHolder ( const SharedMutexImpl lock)
inlineexplicit

Definition at line 1306 of file SharedMutex.h.

1307  : lock_(const_cast<SharedMutexImpl*>(lock)) {
1308  if (lock_) {
1310  }
1311  }
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::ReadHolder ( const SharedMutexImpl lock)
inlineexplicit

Definition at line 1313 of file SharedMutex.h.

1314  : lock_(const_cast<SharedMutexImpl*>(&lock)) {
1316  }
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::ReadHolder ( ReadHolder &&  rhs)
inlinenoexcept

Definition at line 1318 of file SharedMutex.h.

References folly::detail::rhs.

1319  : lock_(rhs.lock_), token_(rhs.token_) {
1320  rhs.lock_ = nullptr;
1321  }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::ReadHolder ( UpgradeHolder &&  upgraded)
inlineexplicit

Definition at line 1324 of file SharedMutex.h.

1324  : lock_(upgraded.lock_) {
1325  assert(upgraded.lock_ != nullptr);
1326  upgraded.lock_ = nullptr;
1328  }
void unlock_upgrade_and_lock_shared()
Definition: SharedMutex.h:537
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::ReadHolder ( WriteHolder &&  writer)
inlineexplicit

Definition at line 1331 of file SharedMutex.h.

1331  : lock_(writer.lock_) {
1332  assert(writer.lock_ != nullptr);
1333  writer.lock_ = nullptr;
1335  }
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::ReadHolder ( const ReadHolder rhs)
delete
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::~ReadHolder ( )
inline

Definition at line 1346 of file SharedMutex.h.

1346  {
1347  unlock();
1348  }

Member Function Documentation

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
ReadHolder& folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::operator= ( ReadHolder &&  rhs)
inlinenoexcept

Definition at line 1337 of file SharedMutex.h.

References folly::detail::rhs, and folly::f14::swap().

1337  {
1338  std::swap(lock_, rhs.lock_);
1339  std::swap(token_, rhs.token_);
1340  return *this;
1341  }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
ReadHolder& folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::operator= ( const ReadHolder rhs)
delete
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
void folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::unlock ( )
inline

Definition at line 1350 of file SharedMutex.h.

1350  {
1351  if (lock_) {
1353  lock_ = nullptr;
1354  }
1355  }

Friends And Related Function Documentation

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
friend class UpgradeHolder
friend

Definition at line 1358 of file SharedMutex.h.

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
friend class WriteHolder
friend

Definition at line 1359 of file SharedMutex.h.

Member Data Documentation

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
SharedMutexImpl* folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::lock_
private

Definition at line 1360 of file SharedMutex.h.

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
SharedMutexToken folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::ReadHolder::token_
private

Definition at line 1361 of file SharedMutex.h.


The documentation for this class was generated from the following file: