Pliki_SOP/Zadania_domowe/zajecia6/seq.lst

30 lines
672 B
Plaintext

BACI System: C-- to PCODE Compiler in C, 11:30 1 Oct 2012
Source file: seq.cm Tue Dec 4 14:48:43 2018
line pc
1 0 semaphore s;
2 0 semaphore t;
3 0
4 0 void a(){
5 0 cout << "Proces 1" <<endl;
6 2 signal(s);
7 4 }
8 5
9 5 void b(){
10 5 wait(s);
11 7 cout <<"Proces 2" <<endl;
12 9 signal(t);
13 11 }
14 12
15 12 void c(){
16 12 wait(t);
17 14 cout <<"Proces 3" <<endl;
18 16 }
19 17
20 17 main(){
21 18 initialsem(s, 0);
22 21 initialsem(t, 0);
23 24 cobegin{
24 25 a(); b(); c();
25 34 }
26 35 }