diff options
Diffstat (limited to 'databases/foundationdb-devel/files/patch-flow_ThreadPrimitives.h')
-rw-r--r-- | databases/foundationdb-devel/files/patch-flow_ThreadPrimitives.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/databases/foundationdb-devel/files/patch-flow_ThreadPrimitives.h b/databases/foundationdb-devel/files/patch-flow_ThreadPrimitives.h new file mode 100644 index 000000000000..fe00d9506ec2 --- /dev/null +++ b/databases/foundationdb-devel/files/patch-flow_ThreadPrimitives.h @@ -0,0 +1,23 @@ +--- flow/ThreadPrimitives.h.orig 2021-01-03 22:45:20 UTC ++++ flow/ThreadPrimitives.h +@@ -47,9 +47,9 @@ + + // TODO: We should make this dependent on the CPU. Maybe cmake + // can set this variable properly? +-constexpr size_t CACHE_LINE_SIZE = 64; ++constexpr size_t MAX_CACHE_LINE_SIZE = 64; + +-class alignas(CACHE_LINE_SIZE) ThreadSpinLock { ++class alignas(MAX_CACHE_LINE_SIZE) ThreadSpinLock { + public: + // #ifdef _WIN32 + ThreadSpinLock() { +@@ -90,7 +90,7 @@ class alignas(CACHE_LINE_SIZE) ThreadSpinLock { (priva + std::atomic_flag isLocked = ATOMIC_FLAG_INIT; + // We want a spin lock to occupy a cache line in order to + // prevent false sharing. +- std::array<uint8_t, CACHE_LINE_SIZE - sizeof(isLocked)> padding; ++ std::array<uint8_t, MAX_CACHE_LINE_SIZE - sizeof(isLocked)> padding; + }; + + class ThreadSpinLockHolder { |