
class semaphore {

public:
  semaphore (int nr = 1) : maxnr_(nr) {number = 0;}
  ~semaphore () {;}
  int acquire ();
  void wait();
  void p();

  void release ();
  void signal();
  void v();
/*
int trywait();
*/

private:
  leda_mutex semalock, aclock, numlock;
  int number;
  int maxnr_;

};

