#include <Thread.h>
Definition at line 263 of file Thread.h.
◆ Mutex()
Definition at line 429 of file Thread.cpp.
430{
431#if __DCL_PTHREAD
433#elif __DCL_WINDOWS
434 InitializeCriticalSection(&__cs);
435#endif
436}
#define __DCL_VERIFY(expr)
◆ ~Mutex()
Thread::Mutex::~Mutex |
( |
| ) |
|
Definition at line 438 of file Thread.cpp.
439{
440#if __DCL_PTHREAD
442#elif __DCL_WINDOWS
443 DeleteCriticalSection(&__cs);
444#endif
445}
◆ lock()
void Thread::Mutex::lock |
( |
| ) |
|
Definition at line 447 of file Thread.cpp.
448{
449#if __DCL_PTHREAD
451#elif __DCL_WINDOWS
452 EnterCriticalSection(&__cs);
453#endif
454}
◆ tryLock()
bool Thread::Mutex::tryLock |
( |
| ) |
|
Definition at line 456 of file Thread.cpp.
457{
458#if __DCL_PTHREAD
459 int r = pthread_mutex_trylock(&__mutex);
461
464#elif __DCL_WINDOWS
465 return TryEnterCriticalSection(&__cs) ==
TRUE;
466#endif
467}
#define __DCL_ASSERT(expr)
◆ unlock()
void Thread::Mutex::unlock |
( |
| ) |
|
Definition at line 469 of file Thread.cpp.
470{
471#if __DCL_PTHREAD
473#elif __DCL_WINDOWS
474 LeaveCriticalSection(&__cs);
475#endif
476}
The documentation for this class was generated from the following files: