diff options
author | Paul Adenot <[email protected]> | 2016-10-06 17:18:30 +0200 |
---|---|---|
committer | Alex Chronopoulos <[email protected]> | 2016-10-18 17:39:53 +0200 |
commit | ddbc367cdf58bdf954feff92035fa4b8aadd84e2 (patch) | |
tree | db902ba8c853fb6e2d7866d50caaa04b3ff15cd6 /src/cubeb_utils_unix.h | |
parent | 2a19364f2480a15532b62ed121b2fadf34d19aa0 (diff) | |
download | cubeb-ddbc367cdf58bdf954feff92035fa4b8aadd84e2.tar.gz cubeb-ddbc367cdf58bdf954feff92035fa4b8aadd84e2.zip |
audiounit: When device change switch to the default device.
Diffstat (limited to 'src/cubeb_utils_unix.h')
-rw-r--r-- | src/cubeb_utils_unix.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cubeb_utils_unix.h b/src/cubeb_utils_unix.h index 72476ac..80219d5 100644 --- a/src/cubeb_utils_unix.h +++ b/src/cubeb_utils_unix.h @@ -20,17 +20,17 @@ public: { pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); -#ifdef DEBUG +#ifndef NDEBUG pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); #else pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL); #endif -#ifdef DEBUG +#ifndef NDEBUG int r = #endif pthread_mutex_init(&mutex, &attr); -#ifdef DEBUG +#ifndef NDEBUG assert(r == 0); #endif @@ -39,40 +39,40 @@ public: ~owned_critical_section() { -#ifdef DEBUG +#ifndef NDEBUG int r = #endif pthread_mutex_destroy(&mutex); -#ifdef DEBUG +#ifndef NDEBUG assert(r == 0); #endif } void enter() { -#ifdef DEBUG +#ifndef NDEBUG int r = #endif pthread_mutex_lock(&mutex); -#ifdef DEBUG +#ifndef NDEBUG assert(r == 0 && "Deadlock"); #endif } void leave() { -#ifdef DEBUG +#ifndef NDEBUG int r = #endif pthread_mutex_unlock(&mutex); -#ifdef DEBUG +#ifndef NDEBUG assert(r == 0 && "Unlocking unlocked mutex"); #endif } void assert_current_thread_owns() { -#ifdef DEBUG +#ifndef NDEBUG int r = pthread_mutex_lock(&mutex); assert(r == EDEADLK); #endif |