Skip to content

Commit

Permalink
fix how to kill a thread
Browse files Browse the repository at this point in the history
Signed-off-by: Shinnosuke Hirakawa <[email protected]>
  • Loading branch information
0x126 committed Mar 1, 2021
1 parent 56a50d9 commit b7952c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pandar_driver/src/driver/nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class DriverNodelet : public nodelet::Nodelet

~DriverNodelet()
{
if (running_) {
NODELET_INFO("shutting down driver thread");
running_ = false;
NODELET_INFO("shutting down driver thread");
running_ = false;
if(deviceThread_.joinable()){
deviceThread_.join();
NODELET_INFO("driver thread stopped");
}
NODELET_INFO("driver thread stopped");
}

private:
Expand Down

0 comments on commit b7952c5

Please sign in to comment.