Semaphore


Detailed Description

Class Semaphore encapsulates the Win32 semaphore.

A semaphore can be used to guard critical sections from simultanuous access from different threads. For example:

#include "wsemaphore.h"

WindowsUtils::Semaphore s;

int shared_count;

void increment()
{
   s.wait();
   ++shared_count;      // critical section
   s.post();
}

void decrement()
{
   s.wait();
   --shared_count;      // critical section
   s.post();
}

Class Sempahore is obtained from [WIN32SEMAPHORE] at [BBDSOFT] with this license.


Classes

class  Semaphore
 encapsulate Win32 semaphore. More...


Generated on Tue Sep 30 11:40:37 2003 for Windows Utilities by doxygen 1.3.4