8#ifndef INCLUDED_BSLMT_TIMEDSEMAPHORE
9#define INCLUDED_BSLMT_TIMEDSEMAPHORE
190#include <bslscm_version.h>
203#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
204#include <bsl_chrono.h>
210template <
class TIMED_SEMAPHORE_POLICY>
253#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
287#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
320 void post(
int value);
337#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
350 template <
class CLOCK,
class DURATION>
351 int timedWait(
const bsl::chrono::time_point<CLOCK, DURATION>& absTime);
384#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
386TimedSemaphore::TimedSemaphore(
const bsl::chrono::system_clock&)
387: d_impl(
bsls::SystemClockType::e_REALTIME)
392TimedSemaphore::TimedSemaphore(
const bsl::chrono::steady_clock&)
393: d_impl(
bsls::SystemClockType::e_MONOTONIC)
399TimedSemaphore::TimedSemaphore(
int count,
401: d_impl(count, clockType)
405#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
407TimedSemaphore::TimedSemaphore(
int count,
408 const bsl::chrono::system_clock&)
409: d_impl(count,
bsls::SystemClockType::e_REALTIME)
414TimedSemaphore::TimedSemaphore(
int count,
415 const bsl::chrono::steady_clock&)
416: d_impl(count,
bsls::SystemClockType::e_MONOTONIC)
442 return d_impl.timedWait(absTime);
445#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
446template <
class CLOCK,
class DURATION>
449 const bsl::chrono::time_point<CLOCK, DURATION>& absTime)
451 return bslmt::ChronoUtil::timedWait(
this, absTime);
458 return d_impl.tryWait();
472 return d_impl.clockType();
Definition bslmt_timedsemaphore.h:211
Definition bslmt_timedsemaphore.h:222
void post()
Atomically increment the count of this timed semaphore.
Definition bslmt_timedsemaphore.h:428
~TimedSemaphore()
Destroy this timed semaphore.
Definition bslmt_timedsemaphore.h:422
@ e_TIMED_OUT
Definition bslmt_timedsemaphore.h:236
bsls::SystemClockType::Enum clockType() const
Return the clock type used for timeouts.
Definition bslmt_timedsemaphore.h:470
void wait()
Definition bslmt_timedsemaphore.h:462
int tryWait()
Definition bslmt_timedsemaphore.h:456
int timedWait(const bsls::TimeInterval &absTime)
Definition bslmt_timedsemaphore.h:440
Definition bsls_timeinterval.h:307
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bslmt_barrier.h:344
Definition bdlt_iso8601util.h:707
Enum
Definition bsls_systemclocktype.h:119
@ e_REALTIME
Definition bsls_systemclocktype.h:122