summaryrefslogtreecommitdiff
path: root/src/semaphore.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-12-20 17:24:31 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-12-20 17:24:31 +0100
commit64e5faf11c22c8aabf181288293c8ec7964c213d (patch)
treef0669001e9eef2aa883df85f401947d843f684b4 /src/semaphore.cc
parentb697682bd3c1b9cdfde97cd6a7c9d0f10103f6b4 (diff)
parent0fa481dabf620181c852f43923a3c4b049294ab4 (diff)
Merge remote-tracking branch 'origin/master' into uirefactor
Diffstat (limited to 'src/semaphore.cc')
-rw-r--r--src/semaphore.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/semaphore.cc b/src/semaphore.cc
index 47ce8e0..3f5781f 100644
--- a/src/semaphore.cc
+++ b/src/semaphore.cc
@@ -28,6 +28,8 @@
#include <hugin.hpp>
+#include <limits>
+
#ifdef WIN32
#include <windows.h>
#else
@@ -53,7 +55,7 @@ Semaphore::Semaphore(const char *name)
#ifdef WIN32
prv->semaphore = CreateSemaphore(NULL, // default security attributes
0, // initial count
- 2147483647, // maximum count (Max LONG)
+ std::numeric_limits<LONG>::max(),
NULL); // unnamed semaphore
#else
sem_init(&prv->semaphore, 0, 0);
@@ -70,7 +72,7 @@ Semaphore::~Semaphore()
sem_destroy(&prv->semaphore);
#endif
- if(prv) delete prv;
+ delete prv;
}
void Semaphore::post()