proxygen
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period > Struct Template Reference

Public Member Functions

 WaitForDuration (const std::chrono::duration< Rep, Period > &duration)
 
std::chrono::steady_clock::time_point deadline ()
 
bool canBlock ()
 
bool canTimeOut ()
 
bool shouldTimeOut ()
 
bool doWait (Futex &futex, uint32_t expected, uint32_t waitMask)
 

Public Attributes

std::chrono::duration< Rep, Period > duration_
 
bool deadlineComputed_
 
std::chrono::steady_clock::time_point deadline_
 

Detailed Description

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

Definition at line 617 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>
template<class Rep , class Period >
folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::WaitForDuration ( const std::chrono::duration< Rep, Period > &  duration)
inlineexplicit

Definition at line 622 of file SharedMutex.h.

623  : duration_(duration), deadlineComputed_(false) {}
std::chrono::duration< Rep, Period > duration_
Definition: SharedMutex.h:618

Member Function Documentation

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
template<class Rep , class Period >
bool folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::canBlock ( )
inline

Definition at line 633 of file SharedMutex.h.

633  {
634  return duration_.count() > 0;
635  }
std::chrono::duration< Rep, Period > duration_
Definition: SharedMutex.h:618
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
template<class Rep , class Period >
bool folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::canTimeOut ( )
inline

Definition at line 636 of file SharedMutex.h.

636  {
637  return true;
638  }
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
template<class Rep , class Period >
std::chrono::steady_clock::time_point folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::deadline ( )
inline

Definition at line 625 of file SharedMutex.h.

References now().

625  {
626  if (!deadlineComputed_) {
628  deadlineComputed_ = true;
629  }
630  return deadline_;
631  }
std::chrono::steady_clock::time_point now()
std::chrono::duration< Rep, Period > duration_
Definition: SharedMutex.h:618
std::chrono::steady_clock::time_point deadline_
Definition: SharedMutex.h:620
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
template<class Rep , class Period >
bool folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::doWait ( Futex futex,
uint32_t  expected,
uint32_t  waitMask 
)
inline

Definition at line 644 of file SharedMutex.h.

References folly::detail::futexWaitUntil(), and folly::detail::TIMEDOUT.

644  {
645  auto result =
646  detail::futexWaitUntil(&futex, expected, deadline(), waitMask);
647  return result != folly::detail::FutexResult::TIMEDOUT;
648  }
std::chrono::steady_clock::time_point deadline()
Definition: SharedMutex.h:625
FutexResult futexWaitUntil(const Futex *futex, uint32_t expected, std::chrono::time_point< Clock, Duration > const &deadline, uint32_t waitMask)
Definition: Futex-inl.h:112
template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
template<class Rep , class Period >
bool folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::shouldTimeOut ( )
inline

Definition at line 640 of file SharedMutex.h.

References now().

640  {
642  }
std::chrono::steady_clock::time_point now()
std::chrono::steady_clock::time_point deadline()
Definition: SharedMutex.h:625

Member Data Documentation

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
template<class Rep , class Period >
std::chrono::steady_clock::time_point folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::deadline_

Definition at line 620 of file SharedMutex.h.

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

Definition at line 619 of file SharedMutex.h.

template<bool ReaderPriority, typename Tag_ = void, template< typename > class Atom = std::atomic, bool BlockImmediately = false, bool AnnotateForThreadSanitizer = kIsSanitizeThread && !ReaderPriority>
template<class Rep , class Period >
std::chrono::duration<Rep, Period> folly::SharedMutexImpl< ReaderPriority, Tag_, Atom, BlockImmediately, AnnotateForThreadSanitizer >::WaitForDuration< Rep, Period >::duration_

Definition at line 618 of file SharedMutex.h.


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