You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have written a cpp application which spawns 2 threads. Each thread is running an advanceable runner.
I am trying to use the BipedalLocomotion::System::handleQuitSignals to implement the logic that should stop the application when clicking ctrl+C.
It follows the portion of the application related to this logic:
// handle the ctrl+c signal
BipedalLocomotion::System::handleQuitSignals([&]() {
plannerRunner.stop();
controllerRunner.stop();
});
// barrier to synchronize the controller and the planner
auto barrier = BipedalLocomotion::System::Barrier::create(2);
// run the planner and controller
auto plannerThread = plannerRunner.run(barrier);
auto controllerThread = controllerRunner.run(barrier);
// wait for the planner and controller threads to finish
while (plannerRunner.isRunning() && controllerRunner.isRunning()) {
using namespace std::chrono_literals;
BipedalLocomotion::clock().yield();
BipedalLocomotion::clock().sleepFor(200ms);
}
// stop the the planner and controller threads
plannerRunner.stop();
controllerRunner.stop();
What happens is that when clicking ctrl+c most of the times the application does not get stopped.
The text was updated successfully, but these errors were encountered:
What happens is that when clicking ctrl+c most of the times the application does not get stopped.
Can you check if the lambda is getting called or not? Can you provide more context of how the handleQuitSignals is being called? Are you calling it from a main() function?
Can you check if the lambda is getting called or not? Can you provide more context of how the handleQuitSignals is being called? Are you calling it from a main() function?
Yes I am calling it from a main() function.
I have verified that when clicking ctrl+c, the function handleQuitSignals does not get invoked.
I have written a cpp application which spawns 2 threads. Each thread is running an
advanceable runner
.I am trying to use the
BipedalLocomotion::System::handleQuitSignals
to implement the logic that should stop the application when clickingctrl+C
.It follows the portion of the application related to this logic:
What happens is that when clicking
ctrl+c
most of the times the application does not get stopped.The text was updated successfully, but these errors were encountered: