freebsd-ports/databases/foundationdb/files/patch-flow_ThreadPrimitives.h
Vanilla I. Shu 5f0593e970 1: Update to 6.1.1.
2: fix building with boost 1.70.
3: remove BROKEN.
2019-04-12 13:04:58 +00:00

34 lines
772 B
C

--- flow/ThreadPrimitives.h.orig 2019-04-09 00:11:05 UTC
+++ flow/ThreadPrimitives.h
@@ -25,7 +25,7 @@
#include "flow/Error.h"
#include "flow/Trace.h"
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD__)
#include <semaphore.h>
#endif
@@ -63,11 +63,11 @@ class ThreadSpinLock { (public)
#endif
}
void leave() {
-#if defined(__linux__)
+#if defined(__linux__) || defined(__FreeBSD__)
__sync_synchronize();
#endif
isLocked = 0;
-#if defined(__linux__)
+#if defined(__linux__) || defined(__FreeBSD__)
__sync_synchronize();
#endif
#if VALGRIND
@@ -116,6 +116,8 @@ class Event { (private)
#ifdef _WIN32
void* ev;
#elif defined(__linux__)
+ sem_t sem;
+#elif defined(__FreeBSD__)
sem_t sem;
#elif defined(__APPLE__)
mach_port_t self;