projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74ff76d
)
(wangle) ManualExecutor::waitFor(F&&)
author
Hans Fugal
<fugalh@fb.com>
Fri, 9 May 2014 22:00:48 +0000
(15:00 -0700)
committer
Dave Watson
<davejwatson@fb.com>
Tue, 20 May 2014 19:53:58 +0000
(12:53 -0700)
Summary:
@override-unit-failures
Test Plan: Using it in
D1322350
Reviewed By: hannesr@fb.com
FB internal diff:
D1322475
folly/wangle/ManualExecutor.h
patch
|
blob
|
history
diff --git
a/folly/wangle/ManualExecutor.h
b/folly/wangle/ManualExecutor.h
index 93c2591aa1b7cc0330d6f5ebe4c40f08d082d1ec..14c455faf0078be2b22f11d17e8be8cba810fb5d 100644
(file)
--- a/
folly/wangle/ManualExecutor.h
+++ b/
folly/wangle/ManualExecutor.h
@@
-42,6
+42,11
@@
namespace folly { namespace wangle {
run();
}
+ template <class F> void waitFor(F const& f) {
+ while (!f.isReady())
+ makeProgress();
+ }
+
private:
std::mutex lock_;
std::queue<std::function<void()>> runnables_;