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

#include <SharedMutex.h>

Public Member Functions

 WriteHolder (SharedMutexImpl *lock)
 
 WriteHolder (SharedMutexImpl &lock)
 
 WriteHolder (UpgradeHolder &&upgrade)
 
 WriteHolder (WriteHolder &&rhs) noexcept
 
WriteHolderoperator= (WriteHolder &&rhs) noexcept
 
 WriteHolder (const WriteHolder &rhs)=delete
 
WriteHolderoperator= (const WriteHolder &rhs)=delete
 
 ~WriteHolder ()
 
void unlock ()
 

Private Member Functions

 WriteHolder ()
 

Private Attributes

SharedMutexImpllock_
 

Friends

class ReadHolder
 
class UpgradeHolder
 

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 >::WriteHolder

Definition at line 1414 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 >::WriteHolder::WriteHolder ( )
inlineprivate

Definition at line 1415 of file SharedMutex.h.

1415 : 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 >::WriteHolder::WriteHolder ( SharedMutexImpl lock)
inlineexplicit

Definition at line 1418 of file SharedMutex.h.

1418  : lock_(lock) {
1419  if (lock_) {
1420  lock_->lock();
1421  }
1422  }
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 >::WriteHolder::WriteHolder ( SharedMutexImpl lock)
inlineexplicit

Definition at line 1424 of file SharedMutex.h.

1424  : lock_(&lock) {
1425  lock_->lock();
1426  }
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 >::WriteHolder::WriteHolder ( UpgradeHolder &&  upgrade)
inlineexplicit

Definition at line 1429 of file SharedMutex.h.

1429  : lock_(upgrade.lock_) {
1430  assert(upgrade.lock_ != nullptr);
1431  upgrade.lock_ = nullptr;
1433  }
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 >::WriteHolder::WriteHolder ( WriteHolder &&  rhs)
inlinenoexcept

Definition at line 1459 of file SharedMutex.h.

References folly::detail::rhs.

1459  : lock_(rhs.lock_) {
1460  rhs.lock_ = nullptr;
1461  }
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 >::WriteHolder::WriteHolder ( const WriteHolder 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 >::WriteHolder::~WriteHolder ( )
inline

Definition at line 1471 of file SharedMutex.h.

1471  {
1472  unlock();
1473  }

Member Function Documentation

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

Definition at line 1463 of file SharedMutex.h.

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

1463  {
1464  std::swap(lock_, rhs.lock_);
1465  return *this;
1466  }
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>
WriteHolder& folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WriteHolder::operator= ( const WriteHolder 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 >::WriteHolder::unlock ( )
inline

Definition at line 1475 of file SharedMutex.h.

1475  {
1476  if (lock_) {
1477  lock_->unlock();
1478  lock_ = nullptr;
1479  }
1480  }

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 ReadHolder
friend

Definition at line 1483 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 UpgradeHolder
friend

Definition at line 1484 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 >::WriteHolder::lock_
private

Definition at line 1485 of file SharedMutex.h.


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