From 5004f31575c52b59e1fc654dfa08336a692afeee Mon Sep 17 00:00:00 2001 From: sapier Date: Mon, 2 Dec 2013 22:21:58 +0100 Subject: Fix broken async locking in release build --- src/jthread/pthread/jsemaphore.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/jthread/pthread/jsemaphore.cpp') diff --git a/src/jthread/pthread/jsemaphore.cpp b/src/jthread/pthread/jsemaphore.cpp index 31bf39466..962b582f1 100644 --- a/src/jthread/pthread/jsemaphore.cpp +++ b/src/jthread/pthread/jsemaphore.cpp @@ -18,25 +18,35 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include #include "jthread/jsemaphore.h" - +#define UNUSED(expr) do { (void)(expr); } while (0) JSemaphore::JSemaphore() { - assert(sem_init(&m_semaphore,0,0) == 0); + int sem_init_retval = sem_init(&m_semaphore,0,0); + assert(sem_init_retval == 0); + UNUSED(sem_init_retval); } JSemaphore::~JSemaphore() { - assert(sem_destroy(&m_semaphore) == 0); + int sem_destroy_retval = sem_destroy(&m_semaphore); + assert(sem_destroy_retval == 0); + UNUSED(sem_destroy_retval); } JSemaphore::JSemaphore(int initval) { - assert(sem_init(&m_semaphore,0,initval) == 0); + int sem_init_retval = sem_init(&m_semaphore,0,initval); + assert(sem_init_retval == 0); + UNUSED(sem_init_retval); } void JSemaphore::Post() { - assert(sem_post(&m_semaphore) == 0); + int sem_post_retval = sem_post(&m_semaphore); + assert(sem_post_retval == 0); + UNUSED(sem_post_retval); } void JSemaphore::Wait() { - assert(sem_wait(&m_semaphore) == 0); + int sem_wait_retval = sem_wait(&m_semaphore); + assert(sem_wait_retval == 0); + UNUSED(sem_wait_retval); } int JSemaphore::GetValue() { -- cgit v1.2.3