From 2c5b84bd1d7a846b10d302ef5da185a75ab2489c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 11 Feb 2024 19:53:05 +0000 Subject: Replace Condition and Mutex with the C++11 standard equivalents. --- src/threadengine.cpp | 45 --------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'src/threadengine.cpp') diff --git a/src/threadengine.cpp b/src/threadengine.cpp index 0ae709db9..5630a99aa 100644 --- a/src/threadengine.cpp +++ b/src/threadengine.cpp @@ -81,48 +81,3 @@ void Thread::OnNotify() this->Join(); this->flags[SF_DEAD] = true; } - -Mutex::Mutex() -{ - pthread_mutex_init(&mutex, NULL); -} - -Mutex::~Mutex() -{ - pthread_mutex_destroy(&mutex); -} - -void Mutex::Lock() -{ - pthread_mutex_lock(&mutex); -} - -void Mutex::Unlock() -{ - pthread_mutex_unlock(&mutex); -} - -bool Mutex::TryLock() -{ - return pthread_mutex_trylock(&mutex) == 0; -} - -Condition::Condition() : Mutex() -{ - pthread_cond_init(&cond, NULL); -} - -Condition::~Condition() -{ - pthread_cond_destroy(&cond); -} - -void Condition::Wakeup() -{ - pthread_cond_signal(&cond); -} - -void Condition::Wait() -{ - pthread_cond_wait(&cond, &mutex); -} -- cgit