diff options
author | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-05-03 13:51:50 +0100 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2019-06-09 11:03:04 +0000 |
commit | 21573956f7b2be8479af25b2e6cfa6c2ec8fae8e (patch) | |
tree | 90e46553908869b05cb82a92d0e6dd337aae1a53 /src/base/fiber.hh | |
parent | 2833eb91ea1266f9bab8be8804ba945451f5b561 (diff) | |
download | gem5-21573956f7b2be8479af25b2e6cfa6c2ec8fae8e.tar.xz |
base: Provide a getter for Fiber::started boolean variable
This can be used to check if the fiber has started its execution.
Change-Id: Ie9222b8076756363c9f82c1333c76a352bcaf817
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18648
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/base/fiber.hh')
-rw-r--r-- | src/base/fiber.hh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/base/fiber.hh b/src/base/fiber.hh index 4d95e032b..ed95050b0 100644 --- a/src/base/fiber.hh +++ b/src/base/fiber.hh @@ -82,6 +82,10 @@ class Fiber /// bool finished() const { return _finished; }; + /// Returns whether the "main" function of this fiber has started. + /// + bool started() const { return _started; }; + /// Get a pointer to the current running Fiber. /// static Fiber *currentFiber(); @@ -96,7 +100,7 @@ class Fiber /// mark itself as finished and switch to its link fiber. virtual void main() = 0; - void setStarted() { started = true; } + void setStarted() { _started = true; } private: static void entryTrampoline(); @@ -114,7 +118,7 @@ class Fiber unsigned valgrindStackId; #endif - bool started; + bool _started; bool _finished; void createContext(); }; |