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(); }; }