Skip to content

Commit

Permalink
additional lock to UpdateDatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
woensug-choi committed Feb 22, 2022
1 parent 8aa836d commit 32c4955
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ void TransientCurrentPlugin::Update(const gazebo::common::UpdateInfo &)
void TransientCurrentPlugin::UpdateDatabase(
const dave_gazebo_ros_plugins::StratifiedCurrentDatabase::ConstPtr &_msg)
{
this->lock_.lock();

this->database.clear();
for (int i = 0; i < _msg->depths.size(); i++)
{
Expand Down Expand Up @@ -299,6 +301,8 @@ void TransientCurrentPlugin::UpdateDatabase(
this->world_start_time[3] = _msg->worldStartTimeHour;
this->world_start_time[4] = _msg->worldStartTimeMinute;
}

this->lock_.unlock();
}

/////////////////////////////////////////////////
Expand Down

0 comments on commit 32c4955

Please sign in to comment.