#include <PsnSequentialSemaphore.h>
Inheritance diagram for PsnSequentialSemaphore:


Public Methods | |
| PsnSequentialSemaphore (const int valeurInitiale) | |
| Constructor. | |
| virtual | ~PsnSequentialSemaphore () |
| Destructor. | |
| virtual int | V () |
| V Increments the semphore value and signals the change to blocked threads. | |
| virtual int | P () |
| P decrement the sempaphore value and block the calling thread if this value is negative. | |
Private Attributes | |
| int | v |
| the value associated to the semaphore | |
generic semaphore when only one thread is supposed to exist
Definition at line 28 of file PsnSequentialSemaphore.h.
|
|
Constructor.
Definition at line 21 of file PsnSequentialSemaphore.cxx. References v.
00021 : PsnSemaphore(valeurInitiale){ 00022 v=valeurInitiale; 00023 } |
|
|
Destructor.
Definition at line 25 of file PsnSequentialSemaphore.cxx.
00025 {
00026 }
|
|
|
P decrement the sempaphore value and block the calling thread if this value is negative.
Implements PsnSemaphore. Definition at line 33 of file PsnSequentialSemaphore.cxx. References PsController::error(), and v.
00033 {
00034 v--;
00035 if (v<0) {
00036 PsController::error("PsnSequentialSemaphore : P : interblocage");
00037 }
00038 return (v+1);
00039 }
|
|
|
V Increments the semphore value and signals the change to blocked threads.
Implements PsnSemaphore. Definition at line 28 of file PsnSequentialSemaphore.cxx. References v.
|
|
|
the value associated to the semaphore
Definition at line 57 of file PsnSequentialSemaphore.h. Referenced by P(), PsnSequentialSemaphore(), and V(). |
| Documentation generated on Mon Nov 25 15:26:28 2002 |
Generated with doxygen 1.2.12 by Dimitri van Heesch , 1997-2001 |