OOStuBS - Technische Informatik II (TI-II)
2.4
|
Basic synchronisation object. Mehr ...
#include <semaphore.h>
Öffentliche Methoden | |
void | interrupt_signal () |
Increase value or wake up blocked thread from interrupt context. | |
void | p () |
Decrease value or block calling thread. | |
Semaphore (unsigned int value) | |
Default Constructor. | |
void | signal () |
Increase value or wake up blocked thread. | |
void | v () |
Increase value or wake up blocked thread. | |
void | wait () |
Decrease value or block calling thread. | |
virtual | ~Semaphore () |
Virtual Destructor to wake up al waiting customers. | |
![]() | |
virtual | ~Waitingroom () |
Destructor reactivating waiting customers. | |
![]() | |
bool | empty () const |
Element * | peek_front () const |
Element * | pop_front () |
void | push_back (Element &e) |
Queue () | |
bool | remove (Element &e) |
virtual | ~Queue () |
Private Attribute | |
unsigned int | value |
Current value of semaphore. |
Basic synchronisation object.
This object can be used to synchronize multiple threads. It posses the method signal, which increases the internal variable and possibly readys a blocked thread. The method wait causes the calling thread to block if the internal value is zero. It inherits from Waitingroom to keep track of all the currently waiting threads.
Definiert in Zeile 29 der Datei semaphore.h.
Semaphore::Semaphore | ( | unsigned int | value | ) |
Default Constructor.
It sets the internal variable to value.
value | The initial value |
Definiert in Zeile 6 der Datei semaphore.cc.
|
inlinevirtual |
Virtual Destructor to wake up al waiting customers.
Definiert in Zeile 43 der Datei semaphore.h.
void Semaphore::interrupt_signal | ( | ) |
Increase value or wake up blocked thread from interrupt context.
Definiert in Zeile 21 der Datei semaphore.cc.
void Semaphore::p | ( | ) |
Decrease value or block calling thread.
Definiert in Zeile 9 der Datei semaphore.cc.
|
inline |
Increase value or wake up blocked thread.
Definiert in Zeile 51 der Datei semaphore.h.
void Semaphore::v | ( | ) |
Increase value or wake up blocked thread.
Definiert in Zeile 17 der Datei semaphore.cc.
|
inline |
Decrease value or block calling thread.
Definiert in Zeile 49 der Datei semaphore.h.
|
private |
Current value of semaphore.
Definiert in Zeile 33 der Datei semaphore.h.