mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 01:50:46 +02:00
Removed potential deadlock
This commit is contained in:
@@ -64,6 +64,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
RobotStateRT(std::condition_variable& msg_cond);
|
RobotStateRT(std::condition_variable& msg_cond);
|
||||||
|
~RobotStateRT();
|
||||||
double getVersion();
|
double getVersion();
|
||||||
double getTime();
|
double getTime();
|
||||||
std::vector<double> getQTarget();
|
std::vector<double> getQTarget();
|
||||||
|
|||||||
@@ -45,6 +45,12 @@ RobotStateRT::RobotStateRT(std::condition_variable& msg_cond) {
|
|||||||
pMsg_cond_ = &msg_cond;
|
pMsg_cond_ = &msg_cond;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RobotStateRT::~RobotStateRT() {
|
||||||
|
/* Make sure nobody is waiting after this thread is destroyed */
|
||||||
|
new_data_available_ = true;
|
||||||
|
pMsg_cond_->notify_all();
|
||||||
|
}
|
||||||
|
|
||||||
bool RobotStateRT::getNewDataAvailable() {
|
bool RobotStateRT::getNewDataAvailable() {
|
||||||
return new_data_available_;
|
return new_data_available_;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user