Baton::ready, a const variant of try_wait
[folly.git] / folly / fibers / Baton.cpp
index baaa15b0ae4cd6695b73758482ea5dceff7cc87e..5780202d86839aec7570cc45987cf8536c6e52d2 100644 (file)
@@ -153,8 +153,7 @@ void Baton::postHelper(intptr_t new_value) {
 }
 
 bool Baton::try_wait() {
-  auto state = waitingFiber_.load();
-  return state == POSTED;
+  return ready();
 }
 
 void Baton::postThread() {