From 7aff2d8017ca38f8e17faf533f6832b012f5c7dd Mon Sep 17 00:00:00 2001 From: Brian Watling Date: Mon, 20 Jul 2015 11:46:02 -0700 Subject: [PATCH] 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 --- folly/experimental/fibers/FiberManager.h | 7 +++++++ 1 file changed, 7 insertions(+) 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). */ -- 2.34.1