moodycamel::spsc_sema::LightweightSemaphore Class Reference

`#include <atomicops.h>`

## Public Types

typedef std::make_signed< std::size_t >::type | ssize_t

## Public Member Functions

| LightweightSemaphore (ssize_t initialCount=0)
bool | tryWait ()
void | wait ()
void | signal (ssize_t count=1)
ssize_t | availableApprox () const

## Member Typedef Documentation

## ssize_t

typedef std::make_signed<std::size_t>::type moodycamel::spsc_sema::LightweightSemaphore::ssize_t

## Constructor & Destructor Documentation

## LightweightSemaphore()

moodycamel::spsc_sema::LightweightSemaphore::LightweightSemaphore | ( | ssize_t | initialCount = `0` | ) |

inline

## Member Function Documentation

## availableApprox()

ssize_t moodycamel::spsc_sema::LightweightSemaphore::availableApprox | ( |  | ) | const

inline

References moodycamel::weak_atomic< T >::load().

Referenced by moodycamel::BlockingReaderWriterQueue< T, MAX_BLOCK_SIZE >::size_approx().

## signal()

void moodycamel::spsc_sema::LightweightSemaphore::signal | ( | ssize_t | count = `1` | ) |

inline

References moodycamel::weak_atomic< T >::fetch_add_release().

Referenced by moodycamel::BlockingReaderWriterQueue< T, MAX_BLOCK_SIZE >::enqueue(), and moodycamel::BlockingReaderWriterQueue< T, MAX_BLOCK_SIZE >::try_enqueue().

## tryWait()

bool moodycamel::spsc_sema::LightweightSemaphore::tryWait | ( |  | ) |

inline

References moodycamel::weak_atomic< T >::fetch_add_acquire(), and moodycamel::weak_atomic< T >::load().

Referenced by moodycamel::BlockingReaderWriterQueue< T, MAX_BLOCK_SIZE >::pop(), moodycamel::BlockingReaderWriterQueue< T, MAX_BLOCK_SIZE >::try_dequeue(), and wait().

## wait()

void moodycamel::spsc_sema::LightweightSemaphore::wait | ( |  | ) |

inline

References tryWait().

Referenced by moodycamel::BlockingReaderWriterQueue< T, MAX_BLOCK_SIZE >::wait_dequeue().

The documentation for this class was generated from the following file:

- atomicops.h