dbp::semaphore Class Reference

Semaphore synchronization class. More...

#include <semaphore.h>

Inherits dbp::semaphore_int.

List of all members.

Public Member Functions

 semaphore ()
 Constructor.
virtual ~semaphore ()
 Destructor.
virtual void lock ()
 Lock the semaphore.
virtual void unlock ()
 Unlock the semaphore.

Detailed Description

Semaphore synchronization class.

This class represents the thread syncronization object, semaphore. It is frequently used in the multithreaded producer-consumer algorithms.


Member Function Documentation

virtual void dbp::semaphore::lock (  )  [virtual]

Lock the semaphore.

lock() decrements the internal lock counter. If the lock counter is greater than zero, then the decrement proceeds, and the function returns immediately. If the lock counter is zero, then the call blocks calling thread until the lock counter rises above zero.

virtual void dbp::semaphore::unlock (  )  [virtual]

Unlock the semaphore.

unlock() increments the internal lock counter. If the lock counter consequently becomes greater than zero, then another thread blocked in the lock() call will be woken up and proceed to lock the semaphore.


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

 
Support This Project
SourceForge.net Logo