opnsense-ports/databases/foundationdb/files/patch-flow_ThreadPrimitives.h
Franco Fichtner 153b229db9 */*: sync with upstream
Taken from: HardenedBSD
2018-05-31 08:24:41 +02:00

34 lines
762 B
C

--- flow/ThreadPrimitives.h.orig 2018-05-11 01:30:59 UTC
+++ flow/ThreadPrimitives.h
@@ -25,7 +25,7 @@
#include "Error.h"
#include "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;