43 #include <QtCore/qglobal.h>
44 #include <QtCore/qmutex.h>
63 template <
typename Rep,
typename Period>
69 int available()
const;
73 template <
typename Rep,
typename Period>
76 template <
typename Clock,
typename Duration>
97 : m_sem(&
sem), m_n(
n) {}
99 : m_sem(
sem), m_n(
n) {}
112 qt_ptr_swap(m_sem,
other.m_sem);
121 return qExchange(m_sem,
nullptr);
The QSemaphore class provides a general counting semaphore.
bool try_acquire() noexcept
bool try_acquire_for(const std::chrono::duration< Rep, Period > &timeout)
QBasicAtomicInteger< quintptr > u
QBasicAtomicInteger< quint64 > u64
bool try_acquire_until(const std::chrono::time_point< Clock, Duration > &tp)
bool tryAcquire(int n, std::chrono::duration< Rep, Period > timeout)
The QSemaphoreReleaser class provides exception-safe deferral of a QSemaphore::release() call.
QSemaphoreReleaser()=default
QSemaphoreReleaser(QSemaphore *sem, int n=1) noexcept
QSemaphoreReleaser(QSemaphoreReleaser &&other) noexcept
QSemaphore * cancel() noexcept
QSemaphoreReleaser(QSemaphore &sem, int n=1) noexcept
void swap(QSemaphoreReleaser &other) noexcept
QSemaphore * semaphore() const noexcept
auto it unsigned count const
void swap(SimpleVector< T > &v1, SimpleVector< T > &v2)
#define Q_DISABLE_COPY(Class)
#define QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(Class)
GLbitfield GLuint64 timeout
[4]
QT_REQUIRE_CONFIG(thread)
QSystemSemaphore sem("market", 3, QSystemSemaphore::Create)
[0]