8#ifndef INCLUDED_BSLMT_TIMEDSEMAPHORE
9#define INCLUDED_BSLMT_TIMEDSEMAPHORE
189#include <bslscm_version.h>
202#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
203#include <bsl_chrono.h>
209template <
class TIMED_SEMAPHORE_POLICY>
251#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
284#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
314 void post(
int value);
331#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
344 template <
class CLOCK,
class DURATION>
345 int timedWait(
const bsl::chrono::time_point<CLOCK, DURATION>& absTime);
378#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
380TimedSemaphore::TimedSemaphore(
const bsl::chrono::system_clock&)
381: d_impl(
bsls::SystemClockType::e_REALTIME)
386TimedSemaphore::TimedSemaphore(
const bsl::chrono::steady_clock&)
387: d_impl(
bsls::SystemClockType::e_MONOTONIC)
393TimedSemaphore::TimedSemaphore(
int count,
395: d_impl(count, clockType)
399#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
401TimedSemaphore::TimedSemaphore(
int count,
402 const bsl::chrono::system_clock&)
403: d_impl(count,
bsls::SystemClockType::e_REALTIME)
408TimedSemaphore::TimedSemaphore(
int count,
409 const bsl::chrono::steady_clock&)
410: d_impl(count,
bsls::SystemClockType::e_MONOTONIC)
436 return d_impl.timedWait(absTime);
439#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
440template <
class CLOCK,
class DURATION>
443 const bsl::chrono::time_point<CLOCK, DURATION>& absTime)
452 return d_impl.tryWait();
466 return d_impl.clockType();
Definition bslmt_timedsemaphore.h:210
Definition bslmt_timedsemaphore.h:221
void post()
Atomically increment the count of this timed semaphore.
Definition bslmt_timedsemaphore.h:422
~TimedSemaphore()
Destroy this timed semaphore.
Definition bslmt_timedsemaphore.h:416
bsls::SystemClockType::Enum clockType() const
Return the clock type used for timeouts.
Definition bslmt_timedsemaphore.h:464
void wait()
Definition bslmt_timedsemaphore.h:456
@ e_TIMED_OUT
Definition bslmt_timedsemaphore.h:234
int tryWait()
Definition bslmt_timedsemaphore.h:450
int timedWait(const bsls::TimeInterval &absTime)
Definition bslmt_timedsemaphore.h:434
Definition bsls_timeinterval.h:301
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bslmt_barrier.h:344
Definition bdlt_iso8601util.h:691
static int timedWait(PRIMITIVE *primitive, const bsl::chrono::time_point< CLOCK, DURATION > &absTime)
Definition bslmt_chronoutil.h:345
Enum
Definition bsls_systemclocktype.h:117
@ e_REALTIME
Definition bsls_systemclocktype.h:120