www.pudn.com > DVBPlayer.rar > semaphore.h, change:2004-07-15,size:442b


 
#ifndef INCLUDED_SEMAPHORE_H_ 
#define INCLUDED_SEMAPHORE_H_ 
				 
#include <windows.h> 
 
#define SEM_LOCKED   0 
#define SEM_UNLOCKED 1 
 
#define WAIT_FOREVER INFINITE 
 
class Semaphore { 
 public: 
    Semaphore(int cnt = SEM_LOCKED); 
    ~Semaphore(); 
    bool Wait(int ms = WAIT_FOREVER); // returns false if it times out 
    void Signal(); 
  
 private: 
    int m_count; 
   	HANDLE m_sem;	 
}; 
 
 
 
#endif // _SEMAPHORE_H_