diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 05:58:48 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 07:49:13 +0100 |
commit | 03d28dde1635e36508cff1f9eabc265cdb5febb9 (patch) | |
tree | ee62d5851315c7b4c2c3c05f8a72e29a6dd4a1e8 /dinput/dinput.cpp | |
parent | f8faca0abecafd6e65d07bd0fdd618070114cdfa (diff) |
compat/mutex: remove
Always use the adaptive QMutex.
Diffstat (limited to 'dinput/dinput.cpp')
-rw-r--r-- | dinput/dinput.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/dinput/dinput.cpp b/dinput/dinput.cpp index 75f398ad..e896f5f1 100644 --- a/dinput/dinput.cpp +++ b/dinput/dinput.cpp @@ -1,10 +1,9 @@ #include "dinput.hpp" -#include "compat/spinlock.hpp" #include <QDebug> int di_t::refcnt{0}; -std::atomic_flag di_t::lock = ATOMIC_FLAG_INIT; diptr di_t::handle; +QMutex di_t::lock; diptr di_t::init_di_() { @@ -33,7 +32,7 @@ di_t::di_t() void di_t::ref_di() { - spinlock_guard l(lock); + QMutexLocker l(&lock); if (!handle) handle = init_di_(); @@ -43,7 +42,7 @@ void di_t::ref_di() void di_t::unref_di() { - spinlock_guard l(lock); + QMutexLocker l(&lock); const int refcnt_ = --refcnt; |