diff options
author | est31 <MTest31@outlook.com> | 2016-12-22 23:16:00 +0100 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2016-12-22 23:16:00 +0100 |
commit | 81d56b94919dceb7b2e51d70b21a7ca22f852bd5 (patch) | |
tree | 1e9ef1be1b3295a8673d6e4f0bdeb4c2d3a6015f /src/threading/event.cpp | |
parent | 8077612dcb48221281e726a60eb97bf73fde462b (diff) | |
parent | 231ac33d34dfaaddf292c5f31b1eae43eeefba2d (diff) | |
download | minetest-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.cpp')
-rw-r--r-- | src/threading/event.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/threading/event.cpp b/src/threading/event.cpp index 165f9d83f..0d5928f10 100644 --- a/src/threading/event.cpp +++ b/src/threading/event.cpp @@ -27,8 +27,8 @@ DEALINGS IN THE SOFTWARE. Event::Event() { -#if __cplusplus < 201103L -# ifdef _WIN32 +#ifndef USE_CPP11_MUTEX +# if USE_WIN_MUTEX event = CreateEvent(NULL, false, false, NULL); # else pthread_cond_init(&cv, NULL); @@ -38,10 +38,10 @@ Event::Event() #endif } -#if __cplusplus < 201103L +#ifndef USE_CPP11_MUTEX Event::~Event() { -#ifdef _WIN32 +#if USE_WIN_MUTEX CloseHandle(event); #else pthread_cond_destroy(&cv); @@ -53,13 +53,13 @@ Event::~Event() void Event::wait() { -#if __cplusplus >= 201103L +#if USE_CPP11_MUTEX MutexAutoLock lock(mutex); while (!notified) { cv.wait(lock); } notified = false; -#elif defined(_WIN32) +#elif USE_WIN_MUTEX WaitForSingleObject(event, INFINITE); #else pthread_mutex_lock(&mutex); @@ -74,11 +74,11 @@ void Event::wait() void Event::signal() { -#if __cplusplus >= 201103L +#if USE_CPP11_MUTEX MutexAutoLock lock(mutex); notified = true; cv.notify_one(); -#elif defined(_WIN32) +#elif USE_WIN_MUTEX SetEvent(event); #else pthread_mutex_lock(&mutex); |