This class implements a semaphore type, optimized for post, for thread synchronization.

Synopsis

Declared in <bslmt_fastpostsemaphore.h>

class FastPostSemaphore;

Enums

Name

Description

ReturnValue

Status codes returned by semaphore operations.

Member Functions

Name

Description

FastPostSemaphore [constructor]

Constructors

clockType

Return the clock type used for timeouts.

disable

Disable waiting on this semaphore.

enable

Enable waiting on this semaphore. If the semaphore is not disabled, this call has no effect.

getDisabledState

Return an odd value if this semaphore is wait disabled, and an even value otherwise.

getValue

Return the current value (count > 0 ? count : 0) of this semaphore.

isDisabled

Return true if this semaphore is wait disabled, and false otherwise. Note that the semaphore is created in the "wait enabled" state.

post

post overloads

postWithRedundantSignal

Atomically increase the count of this semaphore by the specified value.

take

Take up to maximumToTake units from this semaphore.

takeAll

If the count of this semaphore is positive, reduce the count to 0 and return the original value of the count. Otherwise, do nothing and return 0.

timedWait

Block until this semaphore can be acquired or absTime expires.

tryWait

Attempt to decrement this semaphore's count without blocking.

wait

Block until this semaphore's count is positive, then decrement it.

Created with MrDocs