OOStuBS - Technische Informatik II (TI-II)  2.4
Öffentliche Methoden | Private Attribute | Aufstellung aller Elemente
Semaphore Klassenreferenz

Basic synchronisation object. Mehr ...

#include <semaphore.h>

Klassendiagramm für Semaphore:
Inheritance graph
[Legende]
Zusammengehörigkeiten von Semaphore:
Collaboration graph
[Legende]

Ö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.
- Öffentliche Methoden geerbt von Waitingroom
virtual ~Waitingroom ()
 Destructor reactivating waiting customers.
- Öffentliche Methoden geerbt von Queue
bool empty () const
Elementpeek_front () const
Elementpop_front ()
void push_back (Element &e)
 Queue ()
bool remove (Element &e)
virtual ~Queue ()

Private Attribute

unsigned int value
 Current value of semaphore.

Ausführliche Beschreibung

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.

Beschreibung der Konstruktoren und Destruktoren

Semaphore::Semaphore ( unsigned int  value)

Default Constructor.

It sets the internal variable to value.

Parameter
valueThe initial value

Definiert in Zeile 6 der Datei semaphore.cc.

virtual Semaphore::~Semaphore ( )
inlinevirtual

Virtual Destructor to wake up al waiting customers.

Definiert in Zeile 43 der Datei semaphore.h.

Dokumentation der Elementfunktionen

void Semaphore::interrupt_signal ( )

Increase value or wake up blocked thread from interrupt context.

Definiert in Zeile 21 der Datei semaphore.cc.

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

void Semaphore::p ( )

Decrease value or block calling thread.

Definiert in Zeile 9 der Datei semaphore.cc.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

void Semaphore::signal ( )
inline

Increase value or wake up blocked thread.

Definiert in Zeile 51 der Datei semaphore.h.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

void Semaphore::v ( )

Increase value or wake up blocked thread.

Definiert in Zeile 17 der Datei semaphore.cc.

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

void Semaphore::wait ( )
inline

Decrease value or block calling thread.

Definiert in Zeile 49 der Datei semaphore.h.

Hier ist ein Graph, der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

Dokumentation der Datenelemente

unsigned int Semaphore::value
private

Current value of semaphore.

Definiert in Zeile 33 der Datei semaphore.h.


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien: