#ifndef __SEMAPHORE_H__
#define __SEMAPHORE_H__

//#include <windows.h>
#include <limits.h>

//************************************************************
//Semaphore
//************************************************************

class Semaphore {
public:
    Semaphore(LONG MaxValue=LONG_MAX-1,LONG InitialCount=0);
    ~Semaphore();
    BOOL Acquire(int Timeout=0,HANDLE hEvent=NULL);
    BOOL Release();
    LONG Count;

private:
    HANDLE hSemaphore[2];
};

#endif