diff options
author | Jeremy Andrews <athenian200@outlook.com> | 2021-08-24 10:38:44 -0500 |
---|---|---|
committer | Jeremy Andrews <athenian200@outlook.com> | 2021-08-24 10:38:44 -0500 |
commit | cc75c6a6e969cfe2cb3f91969497e17c76aa0ba3 (patch) | |
tree | 8cf24927ca044ba2c278fe540ef096186a62b40b /media/libcubeb/src/cubeb_utils_unix.h | |
parent | ee498381734bdf31ea38b2f5ea4cac3130ae58e3 (diff) | |
download | uxp-cc75c6a6e969cfe2cb3f91969497e17c76aa0ba3.tar.gz |
Issue #1806 - Part 1: Restore libcubeb update.
Restore the proper working environment for libcubeb work after reversion.
Diffstat (limited to 'media/libcubeb/src/cubeb_utils_unix.h')
-rw-r--r-- | media/libcubeb/src/cubeb_utils_unix.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/media/libcubeb/src/cubeb_utils_unix.h b/media/libcubeb/src/cubeb_utils_unix.h index 80219d58b1..b6618ca45e 100644 --- a/media/libcubeb/src/cubeb_utils_unix.h +++ b/media/libcubeb/src/cubeb_utils_unix.h @@ -8,13 +8,12 @@ #if !defined(CUBEB_UTILS_UNIX) #define CUBEB_UTILS_UNIX -#include <pthread.h> #include <errno.h> +#include <pthread.h> #include <stdio.h> /* This wraps a critical section to track the owner in debug mode. */ -class owned_critical_section -{ +class owned_critical_section { public: owned_critical_section() { @@ -29,7 +28,7 @@ public: #ifndef NDEBUG int r = #endif - pthread_mutex_init(&mutex, &attr); + pthread_mutex_init(&mutex, &attr); #ifndef NDEBUG assert(r == 0); #endif @@ -42,29 +41,29 @@ public: #ifndef NDEBUG int r = #endif - pthread_mutex_destroy(&mutex); + pthread_mutex_destroy(&mutex); #ifndef NDEBUG assert(r == 0); #endif } - void enter() + void lock() { #ifndef NDEBUG int r = #endif - pthread_mutex_lock(&mutex); + pthread_mutex_lock(&mutex); #ifndef NDEBUG assert(r == 0 && "Deadlock"); #endif } - void leave() + void unlock() { #ifndef NDEBUG int r = #endif - pthread_mutex_unlock(&mutex); + pthread_mutex_unlock(&mutex); #ifndef NDEBUG assert(r == 0 && "Unlocking unlocked mutex"); #endif @@ -82,8 +81,8 @@ private: pthread_mutex_t mutex; // Disallow copy and assignment because pthread_mutex_t cannot be copied. - owned_critical_section(const owned_critical_section&); - owned_critical_section& operator=(const owned_critical_section&); + owned_critical_section(const owned_critical_section &); + owned_critical_section & operator=(const owned_critical_section &); }; #endif /* CUBEB_UTILS_UNIX */ |