projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Baton::ready, a const variant of try_wait
[folly.git]
/
folly
/
fibers
/
Baton.h
diff --git
a/folly/fibers/Baton.h
b/folly/fibers/Baton.h
index d2b5885fd9dfe61f48a2523d015944214fe492a6..286ded79299cfcc090c06c178236ffc40b1e1f76 100644
(file)
--- a/
folly/fibers/Baton.h
+++ b/
folly/fibers/Baton.h
@@
-40,6
+40,11
@@
class Baton {
~Baton() {}
+ bool ready() const {
+ auto state = waitingFiber_.load();
+ return state == POSTED;
+ }
+
/**
* Puts active fiber to sleep. Returns when post is called.
*/