Allgemeine Semaphore
Allgemeine Semaphore haben als Wert eine natürliche Zahl, sind also synchronisierte Zähler.
class IntSema
{ private int zahl ;
IntSema (int anf) // Konstruktor
{ zahl = anf ;
}
public synchronized void V ()
{ zahl++ ;
notifyAll() ;
}
Vorherige Folie
Nächste Folie
Zurück zur ersten Folie
Graphik-Version anzeigen