00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __JackProcessSync__
00021 #define __JackProcessSync__
00022
00023 #include "JackPlatformPlug.h"
00024 #include "JackPosixMutex.h"
00025 #include "JackException.h"
00026 #include <sys/time.h>
00027 #include <unistd.h>
00028
00029 namespace Jack
00030 {
00031
00036 class JackProcessSync : public JackBasePosixMutex
00037 {
00038
00039 private:
00040
00041 pthread_cond_t fCond;
00042
00043 public:
00044
00045 JackProcessSync():JackBasePosixMutex()
00046 {
00047 int res = pthread_cond_init(&fCond, NULL);
00048 ThrowIf(res != 0, JackException("JackBasePosixMutex: could not init the cond variable"));
00049 }
00050
00051 virtual ~JackProcessSync()
00052 {
00053 pthread_cond_destroy(&fCond);
00054 }
00055
00056 bool TimedWait(long usec);
00057 bool LockedTimedWait(long usec);
00058
00059 void Wait();
00060 void LockedWait();
00061
00062 void Signal();
00063 void LockedSignal();
00064
00065 void SignalAll();
00066 void LockedSignalAll();
00067
00068 };
00069
00070 }
00071
00072 #endif
00073