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 ()
 Signal the semaphore. More...
 
Bool Try ()
 Check the signal. More...
 
Bool Wait ()
 Wait for the signal. More...
 
Bool Wait (System::Time timeout)
 Wait for the signal with timeout. More...
 

Protected Attributes

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

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 ( )

Signal the semaphore.

Returns
true if successful.

◆ Try()

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

Check the signal.

Returns
true if the semaphore was signalled.

◆ Wait() [1/2]

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

Wait for the signal.

Returns
true when the signal arrived.

◆ Wait() [2/2]

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

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.

Member Data Documentation

◆ mHandle

SemaphoreHandle* Murl::System::Semaphore::mHandle
protected

The anonymous semaphore handle for internal use only.


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


Copyright © 2011-2018 Spraylight GmbH.