diff options
Diffstat (limited to 'core/os/mutex.cpp')
-rw-r--r-- | core/os/mutex.cpp | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/core/os/mutex.cpp b/core/os/mutex.cpp index f099b4319a..74c308f646 100644 --- a/core/os/mutex.cpp +++ b/core/os/mutex.cpp @@ -30,31 +30,17 @@ #include "mutex.h" -#include "core/error_macros.h" - -#include <stddef.h> - -Mutex *(*Mutex::create_func)(bool) = 0; - -Mutex *Mutex::create(bool p_recursive) { - - ERR_FAIL_COND_V(!create_func, 0); - - return create_func(p_recursive); -} - -Mutex::~Mutex() { -} - -Mutex *_global_mutex = NULL; +static Mutex _global_mutex; void _global_lock() { - - if (_global_mutex) - _global_mutex->lock(); + _global_mutex.lock(); } -void _global_unlock() { - if (_global_mutex) - _global_mutex->unlock(); +void _global_unlock() { + _global_mutex.unlock(); } + +template class MutexImpl<std::recursive_mutex>; +template class MutexImpl<std::mutex>; +template class MutexLock<MutexImpl<std::recursive_mutex> >; +template class MutexLock<MutexImpl<std::mutex> >; |