summaryrefslogtreecommitdiff
path: root/src/threading/event.h
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2016-12-22 23:16:00 +0100
committerest31 <MTest31@outlook.com>2016-12-22 23:16:00 +0100
commit81d56b94919dceb7b2e51d70b21a7ca22f852bd5 (patch)
tree1e9ef1be1b3295a8673d6e4f0bdeb4c2d3a6015f /src/threading/event.h
parent8077612dcb48221281e726a60eb97bf73fde462b (diff)
parent231ac33d34dfaaddf292c5f31b1eae43eeefba2d (diff)
downloadminetest-81d56b94919dceb7b2e51d70b21a7ca22f852bd5.tar.gz
minetest-81d56b94919dceb7b2e51d70b21a7ca22f852bd5.tar.bz2
minetest-81d56b94919dceb7b2e51d70b21a7ca22f852bd5.zip
Merge 0.4.15 changes into stable-0.4
0.4.15 release!
Diffstat (limited to 'src/threading/event.h')
-rw-r--r--src/threading/event.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/threading/event.h b/src/threading/event.h
index dd5164576..26cb8997a 100644
--- a/src/threading/event.h
+++ b/src/threading/event.h
@@ -26,17 +26,12 @@ DEALINGS IN THE SOFTWARE.
#ifndef THREADING_EVENT_H
#define THREADING_EVENT_H
-#if __cplusplus >= 201103L
+#include "threads.h"
+
+#if USE_CPP11_MUTEX
#include <condition_variable>
#include "threading/mutex.h"
#include "threading/mutex_auto_lock.h"
-#elif defined(_WIN32)
- #ifndef WIN32_LEAN_AND_MEAN
- #define WIN32_LEAN_AND_MEAN
- #endif
- #include <windows.h>
-#else
- #include <pthread.h>
#endif
@@ -49,18 +44,18 @@ DEALINGS IN THE SOFTWARE.
class Event {
public:
Event();
-#if __cplusplus < 201103L
+#ifndef USE_CPP11_MUTEX
~Event();
#endif
void wait();
void signal();
private:
-#if __cplusplus >= 201103L
+#if USE_CPP11_MUTEX
std::condition_variable cv;
Mutex mutex;
bool notified;
-#elif defined(_WIN32)
+#elif USE_WIN_MUTEX
HANDLE event;
#else
pthread_cond_t cv;