Skip to content

Commit 05f4a5e

Browse files
committed
multi thread bug fixed.
1 parent daf53e3 commit 05f4a5e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

robotis_controller/src/robotis_controller/robotis_controller.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,7 @@ void RobotisController::writeControlTableCallback(const robotis_controller_msgs:
15011501
}
15021502
else
15031503
{
1504-
ROS_WARN("WriteControlTable] Unknown item : %s", msg->start_item_name.c_str());
1504+
ROS_WARN("[WriteControlTable] Unknown item : %s", msg->start_item_name.c_str());
15051505
return;
15061506
}
15071507

@@ -1569,6 +1569,8 @@ void RobotisController::syncWriteItemCallback(const robotis_controller_msgs::Syn
15691569
if (item->access_type_ == Read)
15701570
continue;
15711571

1572+
queue_mutex_.lock();
1573+
15721574
int idx = 0;
15731575
if (direct_sync_write_.size() == 0)
15741576
{
@@ -1604,6 +1606,8 @@ void RobotisController::syncWriteItemCallback(const robotis_controller_msgs::Syn
16041606
}
16051607
direct_sync_write_[idx]->addParam(device->id_, data);
16061608
delete[] data;
1609+
1610+
queue_mutex_.unlock();
16071611
}
16081612
}
16091613

0 commit comments

Comments
 (0)