00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __JackPosixMutex__
00023 #define __JackPosixMutex__
00024
00025 #include "JackException.h"
00026 #include "JackCompilerDeps.h"
00027
00028 #include <pthread.h>
00029 #include <stdio.h>
00030 #include <assert.h>
00031
00032 namespace Jack
00033 {
00038 class SERVER_EXPORT JackBasePosixMutex
00039 {
00040
00041 protected:
00042
00043 pthread_mutex_t fMutex;
00044 pthread_t fOwner;
00045
00046 public:
00047
00048 JackBasePosixMutex(const char* name = NULL);
00049 virtual ~JackBasePosixMutex();
00050
00051 bool Lock();
00052 bool Trylock();
00053 bool Unlock();
00054
00055 };
00056
00057 class SERVER_EXPORT JackPosixMutex
00058 {
00059 protected:
00060
00061 pthread_mutex_t fMutex;
00062
00063 public:
00064
00065 JackPosixMutex(const char* name = NULL);
00066 virtual ~JackPosixMutex();
00067
00068 bool Lock();
00069 bool Trylock();
00070 bool Unlock();
00071 };
00072
00073 }
00074
00075 #endif