Pliki_SOP/Zadania_domowe/zajecia6/seq.cm
2018-12-05 17:53:14 +01:00

27 lines
270 B
Plaintext

semaphore s;
semaphore t;
void a(){
cout << "Proces 1" <<endl;
signal(s);
}
void b(){
wait(s);
cout <<"Proces 2" <<endl;
signal(t);
}
void c(){
wait(t);
cout <<"Proces 3" <<endl;
}
main(){
initialsem(s, 0);
initialsem(t, 0);
cobegin{
a(); b(); c();
}
}