00001 #ifndef Semaphore_HPP 00002 #define Semaphore_HPP 00003 00004 #include "Standard.hpp" 00005 #include "Mutex.hpp" 00006 00007 class Semaphore { 00008 private: 00009 Mutex m; 00010 SCHAR state; 00011 char* name; 00012 int color; 00013 int fg; 00014 public: 00015 Semaphore( int init = 0, const char* sem_name = " ", int c = 7 ); 00016 inline virtual ~Semaphore() { } 00017 00018 void P(); 00019 void V(); 00020 SCHAR get(); 00021 00022 // Not implemented. 00023 private: 00024 inline Semaphore( const Semaphore& src ); 00025 inline const Semaphore& operator=( const Semaphore& src ); 00026 }; 00027 00028 #endif