---
name: "corelinux_EventSemaphore"
section: "3"
platform: "linux"
package: "libcorelinux-dev"
version: "0.4.32-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/corelinux_EventSemaphore"
---

# corelinux\_EventSemaphore(3)

EventSemaphore implements a way to queue its caller until a certain event takes place.

## NAME

corelinux::EventSemaphore - **EventSemaphore** implements a way to queue its caller until a certain event takes place.

## SYNOPSIS

`#include <EventSemaphore.hpp>`

Inherits **corelinux::Semaphore**.

### Public Member Functions

**EventSemaphore** (**SemaphoreGroupPtr** aGroup, **SemaphoreIdentifierRef** aIdentifier, Counter aLimit, bool aRecursionFlag=true, bool aBalkingFlag=false)  throw ( NullPointerException )\
 *Default constructor requires the identifier of the semaphore in the semaphore group.*  virtual **~EventSemaphore** (void)\
 *Virtual Destructor.*  virtual bool **isLocked** (void)\
 *Check if semaphore instance is locked.*  **SemaphoreOperationStatus** **post** (void)  throw ( SemaphoreException )\
 *Indicate owner commitment to trigger the event after a finite amount of time.*  virtual **SemaphoreOperationStatus** **lockWithWait** (void)  throw ( SemaphoreException )\
 *Wait for the event associated with this semaphore to take place.*  virtual **SemaphoreOperationStatus** **lockWithNoWait** (void)  throw ( SemaphoreException )\
 *Check if the associated event has taken place.*  virtual **SemaphoreOperationStatus** **release** (void)  throw ( SemaphoreException )\
 *Signal the observer that an event has occured.*  virtual void **setLimit** (Counter aLimit)  throw ( SemaphoreException )\
 *Set the maximum number of listeners allowed on this semaphore.*  virtual Counter **getLimit** (void) const \
 *Get the maximum number of listeners of this semaphore.*

### Protected Member Functions

**EventSemaphore** (void)  throw ( Assertion )\
 *Default constructor throws assert.*  **EventSemaphore** (**EventSemaphoreCref**)  throw ( Assertion )\
 *Copy constructor throws assertion.*  **EventSemaphoreRef** **operator=** (**EventSemaphoreCref**)  throw ( Assertion )\
 *Assignment operator throws assertion.*

## Detailed Description

**EventSemaphore** implements a way to queue its caller until a certain event takes place.

## Constructor & Destructor Documentation

### corelinux::EventSemaphore::EventSemaphore (SemaphoreGroupPtr aGroup, SemaphoreIdentifierRef aIdentifier, Counter aLimit, bool aRecursionFlag = true, bool aBalkingFlag = false) throw ( NullPointerException )

Default constructor requires the identifier of the semaphore in the semaphore group. **Parameters:**

*aGroup* pointer to the owning **SemaphoreGroup** \
 *aIdentifier* The identifier for the **Semaphore** from the **SemaphoreGroup** \
 *aLimit* the maximum number of listeners.

- •

  aLimit \< 0 : infinite number of listeners,

- •

  aLimit \>= 0 : finite number of listeners

*Recursive* true if recursion enabled \
 *Balking* true if balking enabled

## Member Function Documentation

### SemaphoreOperationStatus corelinux::EventSemaphore::lockWithWait (void) throw ( SemaphoreException )` [virtual]`

Wait for the event associated with this semaphore to take place. Block if the event has not occured Implements **corelinux::AbstractSemaphore**.

### void corelinux::EventSemaphore::setLimit (Counter aLimit) throw ( SemaphoreException )` [virtual]`

Set the maximum number of listeners allowed on this semaphore. **Parameters:**

*aLimit* the maximum number of listeners.

- •

  aLimit \< 0: infinite number of listeners,

- •

  aLimit \>= 0: finite number of listeners,

## Author

Generated automatically by Doxygen for CoreLinux++ from the source code.
