Skip to content

Commit 57c7bfe

Browse files
committed
Expose return value of wait_for
Signed-off-by: Tony Najjar <[email protected]>
1 parent 2bc72fd commit 57c7bfe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/behaviortree_cpp/bt_factory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class Tree
121121
/// Sleep for a certain amount of time.
122122
/// This sleep could be interrupted by the method
123123
/// TreeNode::emitWakeUpSignal()
124-
void sleep(std::chrono::system_clock::duration timeout);
124+
bool sleep(std::chrono::system_clock::duration timeout);
125125

126126
~Tree();
127127

src/bt_factory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,9 @@ TreeNode* Tree::rootNode() const
586586
return subtree_nodes.empty() ? nullptr : subtree_nodes.front().get();
587587
}
588588

589-
void Tree::sleep(std::chrono::system_clock::duration timeout)
589+
bool Tree::sleep(std::chrono::system_clock::duration timeout)
590590
{
591-
wake_up_->waitFor(std::chrono::duration_cast<std::chrono::milliseconds>(timeout));
591+
return wake_up_->waitFor(std::chrono::duration_cast<std::chrono::milliseconds>(timeout));
592592
}
593593

594594
Tree::~Tree()

0 commit comments

Comments
 (0)