diff options
author | sapier <Sapier at GMX dot net> | 2013-12-01 01:52:06 +0100 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2013-12-01 16:25:46 +0100 |
commit | 04e9a9d5410a151d232a577b46791d2edffba527 (patch) | |
tree | 26d014a8ba5a9d962f9458f11d23f11f09ab5fff /src/jthread/pthread/jmutex.cpp | |
parent | f3439c40d85967c4f66eeefbc325f9ebf94d75e1 (diff) | |
download | minetest-04e9a9d5410a151d232a577b46791d2edffba527.tar.gz minetest-04e9a9d5410a151d232a577b46791d2edffba527.tar.bz2 minetest-04e9a9d5410a151d232a577b46791d2edffba527.zip |
Cleanup jthread and fix win32 build
Diffstat (limited to 'src/jthread/pthread/jmutex.cpp')
-rw-r--r-- | src/jthread/pthread/jmutex.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
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 <assert.h> #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; } |