OOStuBS - Technische Informatik II (TI-II)
2.4
Hauptseite
Zusätzliche Informationen
Klassen
Dateien
Auflistung der Dateien
Datei-Elemente
src
locking
semaphore.cc
gehe zur Dokumentation dieser Datei
1
#include "
locking/semaphore.h
"
2
#include "
object/scheduler.h
"
3
#include "
object/lock.h
"
4
#include "
locking/scopedLock.h
"
5
6
Semaphore::Semaphore
(
unsigned
int
value) : value(value){
7
}
8
9
void
Semaphore::p
(){
10
ScopedLock
scopedLock(
lock
);
11
if
(
value
==0)
12
scheduler
.
block
(*
this
);
13
else
14
value
--;
15
}
16
17
void
Semaphore::v
(){
18
// ergänzen //
19
}
20
21
void
Semaphore::interrupt_signal
(){
22
// ergänzen //
23
}
Erzeugt am Mon Jun 30 2014 07:13:28 für OOStuBS - Technische Informatik II (TI-II) von
1.8.1.2