File indexing completed on 2025-08-03 08:20:53
0001 #include <pMutex.h>
0002
0003 pMutex::pMutex(const int lockstatus)
0004 {
0005 pthread_mutex_init(&M, 0);
0006
0007 if (lockstatus) pthread_mutex_lock(&M);
0008
0009 }
0010
0011 pMutex::~pMutex()
0012 {
0013 pthread_mutex_destroy(&M);
0014 }
0015
0016
0017
0018
0019 int pMutex::Lock()
0020 {
0021 return pthread_mutex_lock(&M);
0022 }
0023
0024 int pMutex::tryLock()
0025 {
0026 return pthread_mutex_trylock(&M);
0027 }
0028
0029 int pMutex::Release()
0030 {
0031 return pthread_mutex_unlock(&M);
0032 }
0033