glooxd  0.3-svn
Public Member Functions | List of all members
Semaphore Class Reference

#include <semafore.h>

Public Member Functions

 Semaphore (int value=0)
 ~Semaphore ()
void wait ()
bool trywait ()
void post ()

Detailed Description

A simple implementation of semaphore as a wrapper around a pthread or win32 semaphore.

Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
1.1

Definition at line 30 of file semafore.h.

Constructor & Destructor Documentation

Semaphore ( int  value = 0)

Contructs a new simple semaphore.

Parameters
valueThe initial semaphore value.

Definition at line 138 of file semafore.cpp.

~Semaphore ( )

Destructor.

Definition at line 143 of file semafore.cpp.

Member Function Documentation

void post ( )

Posts (adds 1) to the semaphore.

Definition at line 158 of file semafore.cpp.

bool trywait ( )

Tries to wait for the semaphore.

Returns
True if the semaphore could be locked, false otherwise.

Definition at line 153 of file semafore.cpp.

void wait ( )

Waits for the semaphore.

Definition at line 148 of file semafore.cpp.


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