From 2ab4edcdfe5488afa1769f9398d65a9dc3a03860 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Thu, 20 Aug 2020 13:48:59 -0700 Subject: [PATCH] base: Tag API methods and variables in fiber.hh Change-Id: I586183426c8c56929a4640b0a985b4ddbf48c21f Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33054 Reviewed-by: Gabe Black Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/base/fiber.hh | 66 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/src/base/fiber.hh b/src/base/fiber.hh index 513bf0e9a..dc7ef019f 100644 --- a/src/base/fiber.hh +++ b/src/base/fiber.hh @@ -62,40 +62,72 @@ class Fiber { public: + /** + * @ingroup api_fiber + */ const static size_t DefaultStackSize = 0x50000; - /// stack_size is the size of the stack available to this fiber. - /// link points to another fiber which will start executing when this - /// fiber's main function returns. + /** + * @param Link points to another fiber which will start executing when this + * fiber's main function returns. + * @param stack_size is the size of the stack available to this fiber. + * + * @ingroup api_fiber + * @{ + */ Fiber(size_t stack_size=DefaultStackSize); Fiber(Fiber *link, size_t stack_size=DefaultStackSize); + /** @} */ // end of api_fiber + /** + * @ingroup api_fiber + */ virtual ~Fiber(); - /// Start executing the fiber represented by this object. This function - /// will "return" when the current fiber is switched back to later on. + /** + * Start executing the fiber represented by this object. This function + * will "return" when the current fiber is switched back to later on. + * + * @ingroup api_fiber + */ void run(); - /// Returns whether the "main" function of this fiber has finished. - /// + /** + * Returns whether the "main" function of this fiber has finished. + * + * @ingroup api_fiber + */ bool finished() const { return _finished; }; - /// Returns whether the "main" function of this fiber has started. - /// + /** + * Returns whether the "main" function of this fiber has started. + * + * @ingroup api_fiber + */ bool started() const { return _started; }; - /// Get a pointer to the current running Fiber. - /// + /** + * Get a pointer to the current running Fiber. + * + * @ingroup api_fiber + */ static Fiber *currentFiber(); - /// Get a pointer to the primary Fiber. - /// This Fiber represents the thread of execution started by the OS, and - /// which has a Fiber attached to it after the fact. + + /** + * Get a pointer to the primary Fiber. + * This Fiber represents the thread of execution started by the OS, and + * which has a Fiber attached to it after the fact. + * + * @ingroup api_fiber + */ static Fiber *primaryFiber(); protected: - /// This method is called when this fiber is first run. Override it to - /// give your fiber something to do. When main returns, the fiber will - /// mark itself as finished and switch to its link fiber. + /** + * This method is called when this fiber is first run. Override it to + * give your fiber something to do. When main returns, the fiber will + * mark itself as finished and switch to its link fiber. + */ virtual void main() = 0; void setStarted() { _started = true; } -- 2.30.2