diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-28 00:26:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-28 00:26:01 +0100 |
commit | b7b39786840a41a057f531ed13b64e26366befac (patch) | |
tree | b78a2e0bc0b3f49e82e148e8edb741930ff0ce55 /core/bind/core_bind.cpp | |
parent | e66d519286693a03bf59eaba0a5f29c1c9b15d64 (diff) | |
parent | 18fbdbb456c07a56b358bea2e392765fbcbb3283 (diff) | |
download | redot-engine-b7b39786840a41a057f531ed13b64e26366befac.tar.gz |
Merge pull request #36556 from RandomShaper/rework_mutex
Reimplement `Mutex` with C++'s `<mutex>` (plus more)
Diffstat (limited to 'core/bind/core_bind.cpp')
-rw-r--r-- | core/bind/core_bind.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index c1cf061854..d9cc77feb3 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -2583,17 +2583,17 @@ _Semaphore::~_Semaphore() { void _Mutex::lock() { - mutex->lock(); + mutex.lock(); } Error _Mutex::try_lock() { - return mutex->try_lock(); + return mutex.try_lock(); } void _Mutex::unlock() { - mutex->unlock(); + mutex.unlock(); } void _Mutex::_bind_methods() { @@ -2603,16 +2603,6 @@ void _Mutex::_bind_methods() { ClassDB::bind_method(D_METHOD("unlock"), &_Mutex::unlock); } -_Mutex::_Mutex() { - - mutex = Mutex::create(); -} - -_Mutex::~_Mutex() { - - memdelete(mutex); -} - /////////////// void _Thread::_start_func(void *ud) { |