From: Hans Fugal Date: Fri, 9 May 2014 22:00:48 +0000 (-0700) Subject: (wangle) ManualExecutor::waitFor(F&&) X-Git-Tag: v0.22.0~545 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=618a6ec3134b15b76a76a8c68437df66c525cd82;p=folly.git (wangle) ManualExecutor::waitFor(F&&) Summary: @override-unit-failures Test Plan: Using it in D1322350 Reviewed By: hannesr@fb.com FB internal diff: D1322475 --- diff --git a/folly/wangle/ManualExecutor.h b/folly/wangle/ManualExecutor.h index 93c2591a..14c455fa 100644 --- a/folly/wangle/ManualExecutor.h +++ b/folly/wangle/ManualExecutor.h @@ -42,6 +42,11 @@ namespace folly { namespace wangle { run(); } + template void waitFor(F const& f) { + while (!f.isReady()) + makeProgress(); + } + private: std::mutex lock_; std::queue> runnables_;