/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2015-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <chrono>
#include <string>
-#include <folly/Baton.h>
#include <folly/Optional.h>
-#include <folly/ThreadName.h>
#include <folly/io/async/EventBaseManager.h>
#include <folly/portability/GTest.h>
+#include <folly/synchronization/Baton.h>
+#include <folly/system/ThreadName.h>
using namespace std;
using namespace std::chrono;
Baton<> done;
sebt.getEventBase()->runInEventBaseThread([&] { done.post(); });
- ASSERT_TRUE(done.timed_wait(seconds(1)));
+ ASSERT_TRUE(done.try_wait_for(seconds(1)));
}
TEST_F(ScopedEventBaseThreadTest, named_example) {
done.post();
});
- ASSERT_TRUE(done.timed_wait(seconds(1)));
+ ASSERT_TRUE(done.try_wait_for(seconds(1)));
if (createdThreadName) {
ASSERT_EQ(kThreadName.toString(), createdThreadName.value());
}