From: Brian Watling Date: Mon, 20 Jul 2015 18:46:02 +0000 (-0700) Subject: Allow access to a FiberManager's currently running fiber X-Git-Tag: v0.51.0~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7aff2d8017ca38f8e17faf533f6832b012f5c7dd;p=folly.git Allow access to a FiberManager's currently running fiber Summary: Allow access to a FiberManager's currently running fiber Reviewed By: @alikhtarov, @andriigrynenko Differential Revision: D2257201 --- diff --git a/folly/experimental/fibers/FiberManager.h b/folly/experimental/fibers/FiberManager.h index a29c6c2f..fc889069 100644 --- a/folly/experimental/fibers/FiberManager.h +++ b/folly/experimental/fibers/FiberManager.h @@ -224,6 +224,13 @@ class FiberManager : public ::folly::Executor { */ bool hasActiveFiber() const; + /** + * @return The currently running fiber or null if no fiber is executing. + */ + Fiber* currentFiber() const { + return currentFiber_; + } + /** * @return What was the most observed fiber stack usage (in bytes). */