diff options
author | Alex Chronopoulos <[email protected]> | 2016-07-29 11:51:38 +0300 |
---|---|---|
committer | Alex Chronopoulos <[email protected]> | 2016-07-29 11:51:38 +0300 |
commit | f1eab4e9da3429d46ba49ef79676815fe1f6ce7f (patch) | |
tree | 73fc204d151d0ec7fbf9cb8f6dc53cdd3af35959 /src/cubeb_utils_unix.h | |
parent | 9995f8d05aa9218852d82e33163ba1a8da116d4f (diff) | |
download | cubeb-f1eab4e9da3429d46ba49ef79676815fe1f6ce7f.tar.gz cubeb-f1eab4e9da3429d46ba49ef79676815fe1f6ce7f.zip |
Fix gecko build errors
Diffstat (limited to 'src/cubeb_utils_unix.h')
-rw-r--r-- | src/cubeb_utils_unix.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/cubeb_utils_unix.h b/src/cubeb_utils_unix.h index 9b544f1..72041f5 100644 --- a/src/cubeb_utils_unix.h +++ b/src/cubeb_utils_unix.h @@ -18,7 +18,6 @@ class owned_critical_section public: owned_critical_section() { - int r; pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); #ifdef DEBUG @@ -26,15 +25,27 @@ public: #else pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL); #endif - r = pthread_mutex_init(&mutex, &attr); + +#ifdef DEBUG + int r = +#endif + pthread_mutex_init(&mutex, &attr); +#ifdef DEBUG assert(r == 0); +#endif + pthread_mutexattr_destroy(&attr); } ~owned_critical_section() { - int r = pthread_mutex_destroy(&mutex); +#ifdef DEBUG + int r = +#endif + pthread_mutex_destroy(&mutex); +#ifdef DEBUG assert(r == 0); +#endif } void enter() @@ -44,7 +55,7 @@ public: #endif pthread_mutex_lock(&mutex); #ifdef DEBUG - assert(r == 0, "Deadlock"); + assert(r == 0 && "Deadlock"); #endif } @@ -55,7 +66,7 @@ public: #endif pthread_mutex_unlock(&mutex); #ifdef DEBUG - assert(r == 0, "Unlocking unlocked mutex"); + assert(r == 0 && "Unlocking unlocked mutex"); #endif } |