summaryrefslogtreecommitdiff
path: root/databases/foundationdb/files/patch-flow_ThreadPrimitives.h
blob: d8e6af437b9c91b8a26c232311c49767888a2c84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- 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;