00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __JackWinSemaphore__
00021 #define __JackWinSemaphore__
00022
00023 #include "JackSynchro.h"
00024 #include <windows.h>
00025 #include <assert.h>
00026
00027 namespace Jack
00028 {
00029
00034 class JackWinSemaphore : public detail::JackSynchro
00035 {
00036
00037 private:
00038
00039 HANDLE fSemaphore;
00040
00041 protected:
00042
00043 void BuildName(const char* name, const char* server_name, char* res);
00044
00045 public:
00046
00047 JackWinSemaphore(): fSemaphore(NULL)
00048 {}
00049
00050 bool Signal();
00051 bool SignalAll();
00052 bool Wait();
00053 bool TimedWait(long usec);
00054
00055 bool Allocate(const char* name, const char* server_name, int value);
00056 bool Connect(const char* name, const char* server_name);
00057 bool ConnectInput(const char* name, const char* server_name);
00058 bool ConnectOutput(const char* name, const char* server_name);
00059 bool Disconnect();
00060 void Destroy();
00061 };
00062
00063 }
00064
00065 #endif
00066