Commit 6e269d82 authored by Chad Austin's avatar Chad Austin Committed by Facebook GitHub Bot

fix macOS build

Summary: Darwin libc doesn't implement quick_exit, so use std::_Exit instead.

Reviewed By: yfeldblum

Differential Revision: D23592838

fbshipit-source-id: bda318216239965e14b4c97ca184a2303353ed73
parent 65bb1505
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <cassert> #include <cassert>
#include <condition_variable> #include <condition_variable>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#include <mutex> #include <mutex>
#include <string> #include <string>
#include <thread> #include <thread>
...@@ -208,7 +209,7 @@ TEST(SmallLocks, PicoSpinLockThreadSanitizer) { ...@@ -208,7 +209,7 @@ TEST(SmallLocks, PicoSpinLockThreadSanitizer) {
std::lock_guard<Lock> ga(a); std::lock_guard<Lock> ga(a);
// If halt_on_error is turned off for TSAN, then death would // If halt_on_error is turned off for TSAN, then death would
// happen on exit, so give that a chance as well. // happen on exit, so give that a chance as well.
std::quick_exit(1); std::_Exit(1);
}(), }(),
"Cycle in lock order graph"); "Cycle in lock order graph");
} }
...@@ -440,7 +441,7 @@ TEST(SmallLocksk, MicroSpinLockThreadSanitizer) { ...@@ -440,7 +441,7 @@ TEST(SmallLocksk, MicroSpinLockThreadSanitizer) {
std::lock_guard<MicroSpinLock> ga(a); std::lock_guard<MicroSpinLock> ga(a);
// If halt_on_error is turned off for TSAN, then death would // If halt_on_error is turned off for TSAN, then death would
// happen on exit, so give that a chance as well. // happen on exit, so give that a chance as well.
std::quick_exit(1); std::_Exit(1);
}(), }(),
"Cycle in lock order graph"); "Cycle in lock order graph");
} }
...@@ -464,7 +465,7 @@ TEST(SmallLocksk, MicroSpinLockThreadSanitizer) { ...@@ -464,7 +465,7 @@ TEST(SmallLocksk, MicroSpinLockThreadSanitizer) {
*reinterpret_cast<MicroSpinLock*>(&a)); *reinterpret_cast<MicroSpinLock*>(&a));
// If halt_on_error is turned off for TSAN, then death would // If halt_on_error is turned off for TSAN, then death would
// happen on exit, so give that a chance as well. // happen on exit, so give that a chance as well.
std::quick_exit(1); std::_Exit(1);
}(), }(),
"Cycle in lock order graph"); "Cycle in lock order graph");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment