Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
ThreadSemaphore Struct Reference

Detailed Description

A simple semaphore implementation.

The semaphore class is used as a simple mechanism where one thread can send a message to another thread. This means that the underlying implementation of the thread class does not necessarily have to be a semaphore.

#include <ThreadLib.h>

Inherits ThreadSemaphoreBase.

Public Member Functions

 ThreadSemaphore ()
 Create an initially unsignaled notification object (C: ThreadSemaphore_constructor). More...
 
 ~ThreadSemaphore (void)
 Release target resources only after signalers and waiters have stopped (C: ThreadSemaphore_destructor). More...
 
void wait ()
 Block until a notification can be consumed (C: ThreadSemaphore_wait). More...
 
void signal ()
 Signal a waiter or make a notification available for a later wait (C: ThreadSemaphore_signal). More...
 

Constructor & Destructor Documentation

◆ ThreadSemaphore()

ThreadSemaphore::ThreadSemaphore ( )

Create an initially unsignaled notification object (C: ThreadSemaphore_constructor).

No construction status is returned.

◆ ~ThreadSemaphore()

ThreadSemaphore::~ThreadSemaphore ( void  )

Release target resources only after signalers and waiters have stopped (C: ThreadSemaphore_destructor).

Member Function Documentation

◆ signal()

void ThreadSemaphore::signal ( )

Signal a waiter or make a notification available for a later wait (C: ThreadSemaphore_signal).

Queued-notification capacity and whether repeated signals accumulate are port-specific. Returns no status.

◆ wait()

void ThreadSemaphore::wait ( )

Block until a notification can be consumed (C: ThreadSemaphore_wait).

This call has no timeout parameter and returns no status.