userver: engine::SemaphoreLock Class Reference
Loading...
Searching...
No Matches
engine::SemaphoreLock Class Referencefinal

#include <userver/engine/semaphore.hpp>

Detailed Description

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

Definition at line 216 of file 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 ()
 

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 286 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 293 of file semaphore.hpp.

Member Function Documentation

◆ operator bool()

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

Definition at line 240 of file semaphore.hpp.

◆ TryLockFor()

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

Definition at line 300 of file semaphore.hpp.

◆ TryLockUntil()

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

Definition at line 305 of file semaphore.hpp.


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