diff options
Diffstat (limited to 'media/libcubeb/src/cubeb_utils_win.h')
-rw-r--r-- | media/libcubeb/src/cubeb_utils_win.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/media/libcubeb/src/cubeb_utils_win.h b/media/libcubeb/src/cubeb_utils_win.h index 4c47f454c7..2b094cd93d 100644 --- a/media/libcubeb/src/cubeb_utils_win.h +++ b/media/libcubeb/src/cubeb_utils_win.h @@ -8,25 +8,28 @@ #if !defined(CUBEB_UTILS_WIN) #define CUBEB_UTILS_WIN -#include "cubeb-internal.h" #include <windows.h> +#include "cubeb-internal.h" /* This wraps a critical section to track the owner in debug mode, adapted from - NSPR and http://blogs.msdn.com/b/oldnewthing/archive/2013/07/12/10433554.aspx - */ -class owned_critical_section { + NSPR and http://blogs.msdn.com/b/oldnewthing/archive/2013/07/12/10433554.aspx */ +class owned_critical_section +{ public: owned_critical_section() #ifndef NDEBUG - : owner(0) + : owner(0) #endif { InitializeCriticalSection(&critical_section); } - ~owned_critical_section() { DeleteCriticalSection(&critical_section); } + ~owned_critical_section() + { + DeleteCriticalSection(&critical_section); + } - void lock() + void enter() { EnterCriticalSection(&critical_section); #ifndef NDEBUG @@ -35,7 +38,7 @@ public: #endif } - void unlock() + void leave() { #ifndef NDEBUG /* GetCurrentThreadId cannot return 0: it is not a the valid thread id */ @@ -61,8 +64,8 @@ private: #endif // Disallow copy and assignment because CRICICAL_SECTION 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_WIN */ |