9#ifndef INCLUDED_BSLMT_FASTPOSTSEMAPHORE
10#define INCLUDED_BSLMT_FASTPOSTSEMAPHORE
297#include <bslscm_version.h>
311#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
314#include <bsl_chrono.h>
373#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
400#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
438 void post(
int value);
457 int take(
int maximumToTake);
479#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
493 template <
class CLOCK,
class DURATION>
494 int timedWait(
const bsl::chrono::time_point<CLOCK, DURATION>& absTime);
559#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
561FastPostSemaphore::FastPostSemaphore(
const bsl::chrono::system_clock&)
562: d_impl(
bsls::SystemClockType::e_REALTIME)
567FastPostSemaphore::FastPostSemaphore(
const bsl::chrono::steady_clock&)
568: d_impl(
bsls::SystemClockType::e_MONOTONIC)
574FastPostSemaphore::FastPostSemaphore(
int count,
576: d_impl(count, clockType)
580#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
582FastPostSemaphore::FastPostSemaphore(
int count,
583 const bsl::chrono::system_clock&)
584: d_impl(count,
bsls::SystemClockType::e_REALTIME)
589FastPostSemaphore::FastPostSemaphore(
int count,
590 const bsl::chrono::steady_clock&)
591: d_impl(count,
bsls::SystemClockType::e_MONOTONIC)
632 return d_impl.
take(maximumToTake);
647#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
648template <
class CLOCK,
class DURATION>
651 const bsl::chrono::time_point<CLOCK, DURATION>& absTime)
653 return bslmt::ChronoUtil::timedWait(
this, absTime);
666 return d_impl.
wait();
691 return d_impl.isDisabled();
Definition bslmt_condition.h:220
Definition bslmt_fastpostsemaphoreimpl.h:145
int getValue() const
Definition bslmt_fastpostsemaphoreimpl.h:947
int takeAll()
Definition bslmt_fastpostsemaphoreimpl.h:862
void enable()
Definition bslmt_fastpostsemaphoreimpl.h:698
void postWithRedundantSignal(int value, int available, int blocked)
Definition bslmt_fastpostsemaphoreimpl.h:791
void disable()
Definition bslmt_fastpostsemaphoreimpl.h:650
bsls::SystemClockType::Enum clockType() const
Return the clock type used for timeouts.
Definition bslmt_fastpostsemaphoreimpl.h:928
int wait()
Definition bslmt_fastpostsemaphoreimpl.h:907
int tryWait()
Definition bslmt_fastpostsemaphoreimpl.h:888
int timedWait(const bsls::TimeInterval &absTime)
Definition bslmt_fastpostsemaphoreimpl.h:870
void post()
Atomically increment the count of this semaphore.
Definition bslmt_fastpostsemaphoreimpl.h:734
int take(int maximumToTake)
Definition bslmt_fastpostsemaphoreimpl.h:830
@ e_FAILED
Definition bslmt_fastpostsemaphoreimpl.h:230
@ e_SUCCESS
Definition bslmt_fastpostsemaphoreimpl.h:226
@ e_WOULD_BLOCK
Definition bslmt_fastpostsemaphoreimpl.h:229
@ e_TIMED_OUT
Definition bslmt_fastpostsemaphoreimpl.h:228
@ e_DISABLED
Definition bslmt_fastpostsemaphoreimpl.h:227
int getDisabledState() const
Definition bslmt_fastpostsemaphoreimpl.h:936
Definition bslmt_fastpostsemaphore.h:328
void post()
Atomically increment the count of this semaphore.
Definition bslmt_fastpostsemaphore.h:610
bsls::SystemClockType::Enum clockType() const
Return the clock type used for timeouts.
Definition bslmt_fastpostsemaphore.h:671
bool isDisabled() const
Definition bslmt_fastpostsemaphore.h:689
int wait()
Definition bslmt_fastpostsemaphore.h:664
int tryWait()
Definition bslmt_fastpostsemaphore.h:658
void enable()
Definition bslmt_fastpostsemaphore.h:604
int getValue() const
Definition bslmt_fastpostsemaphore.h:683
ReturnValue
Definition bslmt_fastpostsemaphore.h:346
@ e_FAILED
Definition bslmt_fastpostsemaphore.h:357
@ e_SUCCESS
Definition bslmt_fastpostsemaphore.h:347
@ e_DISABLED
Definition bslmt_fastpostsemaphore.h:349
@ e_TIMED_OUT
Definition bslmt_fastpostsemaphore.h:352
@ e_WOULD_BLOCK
Definition bslmt_fastpostsemaphore.h:354
void disable()
Definition bslmt_fastpostsemaphore.h:598
int timedWait(const bsls::TimeInterval &absTime)
Definition bslmt_fastpostsemaphore.h:642
int take(int maximumToTake)
Definition bslmt_fastpostsemaphore.h:630
int takeAll()
Definition bslmt_fastpostsemaphore.h:636
void postWithRedundantSignal(int value, int available, int blocked)
Definition bslmt_fastpostsemaphore.h:622
int getDisabledState() const
Definition bslmt_fastpostsemaphore.h:677
~FastPostSemaphore()=default
Definition bslmt_mutex.h:317
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
Definition bslmt_threadutil.h:379
Definition bsls_atomicoperations.h:836
Enum
Definition bsls_systemclocktype.h:119
@ e_REALTIME
Definition bsls_systemclocktype.h:122