Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QSemaphore Class Reference

#include <qsemaphore.h>

Collaboration diagram for QSemaphore:

Public Member Functions

 QSemaphore (int n=0)
 ~QSemaphore ()
void acquire (int n=1)
bool tryAcquire (int n=1)
bool tryAcquire (int n, int timeout)
bool tryAcquire (int n, QDeadlineTimer timeout)
void release (int n=1)
int available () const
bool try_acquire () noexcept
template<typename Rep, typename Period>
bool try_acquire_for (const std::chrono::duration< Rep, Period > &timeout)
template<typename Clock, typename Duration>
bool try_acquire_until (const std::chrono::time_point< Clock, Duration > &tp)

Detailed Description

Definition at line 16 of file qsemaphore.h.

Constructor & Destructor Documentation

◆ QSemaphore()

QSemaphore::QSemaphore ( int n = 0)
explicit

Definition at line 687 of file qsemaphore.cpp.

◆ ~QSemaphore()

QSemaphore::~QSemaphore ( )

Definition at line 692 of file qsemaphore.cpp.

Member Function Documentation

◆ acquire()

void QSemaphore::acquire ( int n = 1)

Definition at line 697 of file qsemaphore.cpp.

◆ available()

int QSemaphore::available ( ) const

◆ release()

void QSemaphore::release ( int n = 1)

Definition at line 702 of file qsemaphore.cpp.

◆ try_acquire()

bool QSemaphore::try_acquire ( )
inlinenoexcept

Definition at line 38 of file qsemaphore.h.

◆ try_acquire_for()

template<typename Rep, typename Period>
bool QSemaphore::try_acquire_for ( const std::chrono::duration< Rep, Period > & timeout)
inline

Definition at line 40 of file qsemaphore.h.

◆ try_acquire_until()

template<typename Clock, typename Duration>
bool QSemaphore::try_acquire_until ( const std::chrono::time_point< Clock, Duration > & tp)
inline

Definition at line 43 of file qsemaphore.h.

◆ tryAcquire() [1/3]

bool QSemaphore::tryAcquire ( int n,
int timeout )

◆ tryAcquire() [2/3]

bool QSemaphore::tryAcquire ( int n,
QDeadlineTimer timeout )

◆ tryAcquire() [3/3]

bool QSemaphore::tryAcquire ( int n = 1)

Member Data Documentation

◆ d

QSemaphorePrivate* QSemaphore::d

Definition at line 51 of file qsemaphore.h.

◆ u

QBasicAtomicInteger<quintptr> QSemaphore::u

Definition at line 52 of file qsemaphore.h.

◆ u32

QBasicAtomicInteger<quint32> QSemaphore::u32[2]

Definition at line 53 of file qsemaphore.h.

◆ u64

QBasicAtomicInteger<quint64> QSemaphore::u64

Definition at line 54 of file qsemaphore.h.


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