aboutsummaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-base_allocator_partition__allocator_spinning__mutex.h
blob: e40dd3c13a0e728c8bfa34ea5230e27d62e61ebb (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
--- base/allocator/partition_allocator/spinning_mutex.h.orig	2021-04-14 18:40:48 UTC
+++ base/allocator/partition_allocator/spinning_mutex.h
@@ -22,7 +22,11 @@
 #define PA_HAS_LINUX_KERNEL
 #endif
 
-#if defined(PA_HAS_LINUX_KERNEL) || defined(OS_WIN)
+#if defined(OS_FREEBSD)
+#define PA_HAS_FREEBSD_KERNEL
+#endif
+
+#if defined(PA_HAS_LINUX_KERNEL) || defined(PA_HAS_FREEBSD_KERNEL) || defined(OS_WIN)
 #define PA_HAS_SPINNING_MUTEX
 #endif
 
@@ -66,7 +70,7 @@ class LOCKABLE BASE_EXPORT SpinningMutex {
   // as the slow path has better characteristics than SpinLocks's.
   static constexpr int kSpinCount = 1000;
 
-#if defined(PA_HAS_LINUX_KERNEL)
+#if defined(PA_HAS_LINUX_KERNEL) || defined(PA_HAS_FREEBSD_KERNEL)
   void FutexWait();
   void FutexWake();
 
@@ -111,7 +115,7 @@ ALWAYS_INLINE void SpinningMutex::Acquire() {
 
 inline constexpr SpinningMutex::SpinningMutex() = default;
 
-#if defined(PA_HAS_LINUX_KERNEL)
+#if defined(PA_HAS_LINUX_KERNEL) || defined(PA_HAS_FREEBSD_KERNEL)
 
 ALWAYS_INLINE bool SpinningMutex::Try() {
   int expected = kUnlocked;