diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-06-06 16:29:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-06 16:29:28 +0200 |
commit | d4c0f91275fe70fef73b316c36abfb989dfd55b1 (patch) | |
tree | 6bbd5ebbdbac352c2991854fd88d84abe3ac2224 /src/threading/event.h | |
parent | 8bdde45895658f16aa6b2546ccb59c5c4c9fc699 (diff) | |
download | minetest-d4c0f91275fe70fef73b316c36abfb989dfd55b1.tar.gz minetest-d4c0f91275fe70fef73b316c36abfb989dfd55b1.tar.bz2 minetest-d4c0f91275fe70fef73b316c36abfb989dfd55b1.zip |
Use C++11 mutexes only (remove compat code) (#5922)
* Fix event LINT & remove default constructor/destructors
* remove compat code & modernize autolock header
Diffstat (limited to 'src/threading/event.h')
-rw-r--r-- | src/threading/event.h | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/threading/event.h b/src/threading/event.h index 79a99ce1f..458864c82 100644 --- a/src/threading/event.h +++ b/src/threading/event.h @@ -28,11 +28,8 @@ DEALINGS IN THE SOFTWARE. #include "threads.h" -#if USE_CPP11_MUTEX #include <condition_variable> -#include "threading/mutex.h" #include "threading/mutex_auto_lock.h" -#endif /** A syncronization primitive that will wake up one waiting thread when signaled. * Calling @c signal() multiple times before a waiting thread has had a chance @@ -43,25 +40,13 @@ DEALINGS IN THE SOFTWARE. class Event { public: - Event(); -#ifndef USE_CPP11_MUTEX - ~Event(); -#endif void wait(); void signal(); private: -#if USE_CPP11_MUTEX std::condition_variable cv; - Mutex mutex; - bool notified; -#elif USE_WIN_MUTEX - HANDLE event; -#else - pthread_cond_t cv; - pthread_mutex_t mutex; - bool notified; -#endif + std::mutex mutex; + bool notified = false; }; #endif |