File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,6 +137,14 @@ class Tree
137137 */
138138 void emitWakeUpSignal ();
139139
140+ /* *
141+ * @brief Returns the shared WakeUpSignal used by this tree.
142+ * This can be used to check for preemption externally, e.g. when
143+ * implementing custom sleep logic with a different clock source.
144+ * Returns nullptr if the tree has not been initialized yet.
145+ */
146+ [[nodiscard]] std::shared_ptr<WakeUpSignal> wakeUpSignal () const ;
147+
140148 ~Tree ();
141149
142150 // / Tick the root of the tree once, even if a node invoked
Original file line number Diff line number Diff line change @@ -664,6 +664,11 @@ void Tree::emitWakeUpSignal()
664664 wake_up_->emitSignal ();
665665}
666666
667+ std::shared_ptr<WakeUpSignal> Tree::wakeUpSignal () const
668+ {
669+ return wake_up_;
670+ }
671+
667672Tree::~Tree ()
668673{
669674 haltTree ();
You can’t perform that action at this time.
0 commit comments