Skip to content

Commit a33b312

Browse files
committed
2 parents ca14aa8 + 470eba8 commit a33b312

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/action_node.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,15 @@ NodeStatus AsyncActionNode::executeTick()
131131
void AsyncActionNode::stopAndJoinThread()
132132
{
133133
keep_thread_alive_.store(false);
134-
notifyStart();
134+
if( status() == NodeStatus::RUNNING )
135+
{
136+
halt();
137+
}
138+
else{
139+
// loop in asyncThreadLoop() is blocked at waitStart(). Unblock it.
140+
notifyStart();
141+
}
142+
135143
if (thread_.joinable())
136144
{
137145
thread_.join();

0 commit comments

Comments
 (0)