19 #include <glog/logging.h> 25 TEST(ThreadLocal, AtFork) {
39 auto pid2 =
wait(&status);
51 auto pid2 =
wait(&status);
60 TEST(ThreadLocal, AtForkOrdering) {
61 std::atomic<bool> done{
false};
62 std::atomic<bool> started{
false};
69 [&] {
return a.try_lock(); },
74 [&] {
return b.try_lock(); },
78 auto thr = std::thread([&]() {
79 std::lock_guard<std::mutex>
g(a);
82 std::lock_guard<std::mutex> g2(b);
89 auto pid2 =
wait(&status);
#define EXPECT_EQ(val1, val2)
FOLLY_NOINLINE void foo2()
bool wait(Waiter *waiter, bool shouldSleep, Waiter *&next)
#define EXPECT_TRUE(condition)
TEST(ThreadLocal, AtFork)
static void unregisterHandler(void *object)
#define EXPECT_FALSE(condition)
static void registerHandler(void *object, folly::Function< bool()> prepare, folly::Function< void()> parent, folly::Function< void()> child)