From 04e9a9d5410a151d232a577b46791d2edffba527 Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 1 Dec 2013 01:52:06 +0100 Subject: Cleanup jthread and fix win32 build --- src/jthread/pthread/jmutex.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'src/jthread/pthread/jmutex.cpp') diff --git a/src/jthread/pthread/jmutex.cpp b/src/jthread/pthread/jmutex.cpp index 3dfad5e6c..bcc3853d2 100644 --- a/src/jthread/pthread/jmutex.cpp +++ b/src/jthread/pthread/jmutex.cpp @@ -24,40 +24,27 @@ DEALINGS IN THE SOFTWARE. */ - +#include #include "jthread/jmutex.h" JMutex::JMutex() { - pthread_mutex_init(&mutex,NULL); - initialized = true; + assert(pthread_mutex_init(&mutex,NULL) == 0); } JMutex::~JMutex() { - if (initialized) - pthread_mutex_destroy(&mutex); -} - -int JMutex::Init() -{ - return 0; + assert(pthread_mutex_destroy(&mutex) == 0); } int JMutex::Lock() { - if (!initialized) - return ERR_JMUTEX_NOTINIT; - - pthread_mutex_lock(&mutex); + assert(pthread_mutex_lock(&mutex) == 0); return 0; } int JMutex::Unlock() { - if (!initialized) - return ERR_JMUTEX_NOTINIT; - - pthread_mutex_unlock(&mutex); + assert(pthread_mutex_unlock(&mutex) == 0); return 0; } -- cgit v1.2.3