projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Futex::futexWait returns FutexResult
[folly.git]
/
folly
/
test
/
FutexTest.cpp
diff --git
a/folly/test/FutexTest.cpp
b/folly/test/FutexTest.cpp
index
464c852
..
7da35b7
100644
(file)
--- a/
folly/test/FutexTest.cpp
+++ b/
folly/test/FutexTest.cpp
@@
-39,14
+39,14
@@
typedef DeterministicSchedule DSched;
template <template <typename> class Atom>
void run_basic_thread(
Futex<Atom>& f) {
template <template <typename> class Atom>
void run_basic_thread(
Futex<Atom>& f) {
- EXPECT_
TRUE(
f.futexWait(0));
+ EXPECT_
EQ(FutexResult::AWOKEN,
f.futexWait(0));
}
template <template <typename> class Atom>
void run_basic_tests() {
Futex<Atom> f(0);
}
template <template <typename> class Atom>
void run_basic_tests() {
Futex<Atom> f(0);
- EXPECT_
FALSE(
f.futexWait(1));
+ EXPECT_
EQ(FutexResult::VALUE_CHANGED,
f.futexWait(1));
EXPECT_EQ(f.futexWake(), 0);
auto thr = DSched::thread(std::bind(run_basic_thread<Atom>, std::ref(f)));
EXPECT_EQ(f.futexWake(), 0);
auto thr = DSched::thread(std::bind(run_basic_thread<Atom>, std::ref(f)));
@@
-191,7
+191,8
@@
void run_wake_blocked_test() {
for (auto delay = std::chrono::milliseconds(1);; delay *= 2) {
bool success = false;
Futex<Atom> f(0);
for (auto delay = std::chrono::milliseconds(1);; delay *= 2) {
bool success = false;
Futex<Atom> f(0);
- auto thr = DSched::thread([&] { success = f.futexWait(0); });
+ auto thr = DSched::thread(
+ [&] { success = FutexResult::AWOKEN == f.futexWait(0); });
/* sleep override */ std::this_thread::sleep_for(delay);
f.store(1);
f.futexWake(1);
/* sleep override */ std::this_thread::sleep_for(delay);
f.store(1);
f.futexWake(1);