userver: engine::SemaphoreLock Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
engine::SemaphoreLock Class Referencefinal

A replacement for std::shared_lock that accepts Deadline arguments. More...

#include <userver/engine/semaphore.hpp>

Public Member Functions

 SemaphoreLock (Semaphore &)
 
 SemaphoreLock (Semaphore &, std::defer_lock_t) noexcept
 
 SemaphoreLock (Semaphore &, std::try_to_lock_t)
 
 SemaphoreLock (Semaphore &, std::adopt_lock_t) noexcept
 
template<typename Rep , typename Period >
 SemaphoreLock (Semaphore &, std::chrono::duration< Rep, Period >)
 
template<typename Clock , typename Duration >
 SemaphoreLock (Semaphore &, std::chrono::time_point< Clock, Duration >)
 
 SemaphoreLock (Semaphore &, Deadline)
 
 SemaphoreLock (const SemaphoreLock &)=delete
 
 SemaphoreLock (SemaphoreLock &&) noexcept
 
SemaphoreLockoperator= (const SemaphoreLock &)=delete
 
SemaphoreLockoperator= (SemaphoreLock &&) noexcept
 
bool OwnsLock () const noexcept
 
 operator bool () const noexcept
 
void Lock ()
 
bool TryLock ()
 
template<typename Rep , typename Period >
bool TryLockFor (std::chrono::duration< Rep, Period >)
 
template<typename Clock , typename Duration >
bool TryLockUntil (std::chrono::time_point< Clock, Duration >)
 
bool TryLockUntil (Deadline)
 
void Unlock ()
 
void Release ()
 

Detailed Description

A replacement for std::shared_lock that accepts Deadline arguments.

Definition at line 207 of file semaphore.hpp.

Constructor & Destructor Documentation

◆ SemaphoreLock() [1/2]

template<typename Rep , typename Period >
engine::SemaphoreLock::SemaphoreLock ( Semaphore sem,
std::chrono::duration< Rep, Period >  duration 
)

Definition at line 277 of file semaphore.hpp.

◆ SemaphoreLock() [2/2]

template<typename Clock , typename Duration >
engine::SemaphoreLock::SemaphoreLock ( Semaphore sem,
std::chrono::time_point< Clock, Duration >  until 
)

Definition at line 284 of file semaphore.hpp.

Member Function Documentation

◆ operator bool()

engine::SemaphoreLock::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 231 of file semaphore.hpp.

◆ TryLockFor()

template<typename Rep , typename Period >
bool engine::SemaphoreLock::TryLockFor ( std::chrono::duration< Rep, Period >  duration)

Definition at line 291 of file semaphore.hpp.

◆ TryLockUntil()

template<typename Clock , typename Duration >
bool engine::SemaphoreLock::TryLockUntil ( std::chrono::time_point< Clock, Duration >  until)

Definition at line 296 of file semaphore.hpp.


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