The semaphore class for thread synchronization. More...

#include "murl_system_semaphore.h"

Inheritance diagram for Murl::System::Semaphore:

Public Member Functions

 Semaphore ()
 The default constructor.
 
 ~Semaphore ()
 The destructor.
 
Bool Signal () const
 Signal the semaphore. More...
 
Bool Try () const
 Check the signal. More...
 
Bool Wait () const
 Wait for the signal. More...
 
Bool Wait (Time timeout) const
 Wait for the signal with timeout. More...
 
- Public Member Functions inherited from Murl::NonCopyable
 NonCopyable ()=default
 The default constructor.
 

Protected Attributes

SemaphoreHandle * mHandle
 The anonymous semaphore handle for internal use only.
 

Detailed Description

The semaphore class for thread synchronization.

One thread can Wait() for a signal until another thread is sending the Signal().

Member Function Documentation

◆ Signal()

Bool Murl::System::Semaphore::Signal ( ) const

Signal the semaphore.

Returns
true if successful.

◆ Try()

Bool Murl::System::Semaphore::Try ( ) const

Check the signal.

Returns
true if the semaphore was signaled.

◆ Wait() [1/2]

Bool Murl::System::Semaphore::Wait ( ) const

Wait for the signal.

Returns
true when the signal arrived.

◆ Wait() [2/2]

Bool Murl::System::Semaphore::Wait ( Time  timeout) const

Wait for the signal with timeout.

Parameters
timeoutThe maximum time to wait for the signal.
Returns
true when the signal arrived, false if the timeout elapsed.

The documentation for this class was generated from the following file:
  • murl_system_semaphore.h


Copyright © 2011-2024 Spraylight GmbH.