65 InitializeCriticalSection(&C);
67 pthread_mutexattr_t attr;
68 pthread_mutexattr_init(&attr);
69 pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE);
70 pthread_mutex_init(&
M,&attr);
71 pthread_mutexattr_destroy(&attr);
78 DeleteCriticalSection(&C);
80 pthread_mutex_unlock(&
M); pthread_mutex_destroy(&
M);
90 EnterCriticalSection(&C);
return 0;
92 return pthread_mutex_lock(&
M);
97 #if(_WIN32_WINNT >= 0x0400) 100 return (TryEnterCriticalSection(&C)?0:EBUSY);
106 return pthread_mutex_trylock(&
M);
116 LeaveCriticalSection(&C);
return 0;
118 return pthread_mutex_unlock(&
M);
124 mutable CRITICAL_SECTION C;
126 mutable pthread_mutex_t
M;
UScopeMutex(UMutex *mutex)
UScopeMutex(const UMutex &mutex)
void operator=(UMutex &M)