9#ifndef INCLUDED_BSLMT_FASTPOSTSEMAPHORE
10#define INCLUDED_BSLMT_FASTPOSTSEMAPHORE
296#include <bslscm_version.h>
310#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
313#include <bsl_chrono.h>
371#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
398#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
435 void post(
int value);
452 int take(
int maximumToTake);
474#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
488 template <
class CLOCK,
class DURATION>
489 int timedWait(
const bsl::chrono::time_point<CLOCK, DURATION>& absTime);
553#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
555FastPostSemaphore::FastPostSemaphore(
const bsl::chrono::system_clock&)
556: d_impl(
bsls::SystemClockType::e_REALTIME)
561FastPostSemaphore::FastPostSemaphore(
const bsl::chrono::steady_clock&)
562: d_impl(
bsls::SystemClockType::e_MONOTONIC)
568FastPostSemaphore::FastPostSemaphore(
int count,
570: d_impl(count, clockType)
574#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
576FastPostSemaphore::FastPostSemaphore(
int count,
577 const bsl::chrono::system_clock&)
578: d_impl(count,
bsls::SystemClockType::e_REALTIME)
583FastPostSemaphore::FastPostSemaphore(
int count,
584 const bsl::chrono::steady_clock&)
585: d_impl(count,
bsls::SystemClockType::e_MONOTONIC)
626 return d_impl.
take(maximumToTake);
641#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
642template <
class CLOCK,
class DURATION>
645 const bsl::chrono::time_point<CLOCK, DURATION>& absTime)
660 return d_impl.
wait();
685 return d_impl.isDisabled();
Definition bslmt_condition.h:220
Definition bslmt_fastpostsemaphoreimpl.h:145
int getValue() const
Definition bslmt_fastpostsemaphoreimpl.h:936
int takeAll()
Definition bslmt_fastpostsemaphoreimpl.h:851
void enable()
Definition bslmt_fastpostsemaphoreimpl.h:687
void postWithRedundantSignal(int value, int available, int blocked)
Definition bslmt_fastpostsemaphoreimpl.h:780
void disable()
Definition bslmt_fastpostsemaphoreimpl.h:639
bsls::SystemClockType::Enum clockType() const
Return the clock type used for timeouts.
Definition bslmt_fastpostsemaphoreimpl.h:917
int wait()
Definition bslmt_fastpostsemaphoreimpl.h:896
int tryWait()
Definition bslmt_fastpostsemaphoreimpl.h:877
int timedWait(const bsls::TimeInterval &absTime)
Definition bslmt_fastpostsemaphoreimpl.h:859
void post()
Atomically increment the count of this semaphore.
Definition bslmt_fastpostsemaphoreimpl.h:723
int take(int maximumToTake)
Definition bslmt_fastpostsemaphoreimpl.h:819
@ e_FAILED
Definition bslmt_fastpostsemaphoreimpl.h:229
@ e_SUCCESS
Definition bslmt_fastpostsemaphoreimpl.h:225
@ e_WOULD_BLOCK
Definition bslmt_fastpostsemaphoreimpl.h:228
@ e_TIMED_OUT
Definition bslmt_fastpostsemaphoreimpl.h:227
@ e_DISABLED
Definition bslmt_fastpostsemaphoreimpl.h:226
int getDisabledState() const
Definition bslmt_fastpostsemaphoreimpl.h:925
Definition bslmt_fastpostsemaphore.h:327
void post()
Atomically increment the count of this semaphore.
Definition bslmt_fastpostsemaphore.h:604
bsls::SystemClockType::Enum clockType() const
Return the clock type used for timeouts.
Definition bslmt_fastpostsemaphore.h:665
bool isDisabled() const
Definition bslmt_fastpostsemaphore.h:683
int wait()
Definition bslmt_fastpostsemaphore.h:658
int tryWait()
Definition bslmt_fastpostsemaphore.h:652
void enable()
Definition bslmt_fastpostsemaphore.h:598
int getValue() const
Definition bslmt_fastpostsemaphore.h:677
ReturnValue
Definition bslmt_fastpostsemaphore.h:344
@ e_FAILED
Definition bslmt_fastpostsemaphore.h:355
@ e_SUCCESS
Definition bslmt_fastpostsemaphore.h:345
@ e_DISABLED
Definition bslmt_fastpostsemaphore.h:347
@ e_TIMED_OUT
Definition bslmt_fastpostsemaphore.h:350
@ e_WOULD_BLOCK
Definition bslmt_fastpostsemaphore.h:352
void disable()
Definition bslmt_fastpostsemaphore.h:592
int timedWait(const bsls::TimeInterval &absTime)
Definition bslmt_fastpostsemaphore.h:636
int take(int maximumToTake)
Definition bslmt_fastpostsemaphore.h:624
int takeAll()
Definition bslmt_fastpostsemaphore.h:630
void postWithRedundantSignal(int value, int available, int blocked)
Definition bslmt_fastpostsemaphore.h:616
int getDisabledState() const
Definition bslmt_fastpostsemaphore.h:671
~FastPostSemaphore()=default
Definition bslmt_mutex.h:315
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
Definition bslmt_threadutil.h:375
Definition bsls_atomicoperations.h:834
Enum
Definition bsls_systemclocktype.h:117
@ e_REALTIME
Definition bsls_systemclocktype.h:120