// a simple semaphore class // // October 1995 // Bastiaan Sch\"onhage ifndef SEMAPHORE_H define SEMAPHORE_H include <hush/export.h>
class semaphore { public: semaphore(int count, int process = 0); // set process to 1 for virtual ~semaphore(); // semphores between processes void up(); // increase semaphore void down(); // decrease, block on 0 int trydown(); // 1-success; 0-failure (semaphore=0) private: void* sp; };
endif
Hush Online Technology
hush@cs.vu.nl
09/09/98 |
![]() |
![]() |