#ifndef _NitY_h_ #define _NitY_h_ #include "Thread.h" #include "iostream.h" #include "Semaphore.h" class NitY : public Thread { public: NitY(Semaphore* s1, Semaphore* s2, int *x, int *y, int *z) { this->s1 = s1; this->s2 = s2; this->x = x; this->y = y; this->z = z; } protected: virtual void run(){ int kraj = 0; while(!kraj) { s1->wait(); *z = *x + *y; if (*x == 10) kraj = 1; s2->signal(); } cout << "NitY finnished" << endl; } int *x, *y, *z; Semaphore *s1, *s2; }; #endif // _NitY_h_