Pliki_SOP/Zadania_domowe/test2/zad2.cm

19 lines
277 B
Plaintext
Raw Normal View History

2018-12-10 12:01:06 +01:00
monitor s{
condition c;
int elem;
void pushElement(int val){
elem = val;
signalc(c);
}
int getElement(){
waitc(c);
return elem;
}
init { elem = 0; }
}
void prod() { pushElement(10); }
void kons() { cout << getElement(); }
main(){
cobegin { prod(); kons(); };
}