Skip to content

Commit

Permalink
Fix missing locks in tesseract_environment (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoomen authored Sep 13, 2023
1 parent 8b5dd78 commit 49c9497
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tesseract_environment/src/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ void Environment::setState(const std::unordered_map<std::string, double>& joints
currentStateChanged();
}

std::shared_lock<std::shared_mutex> lock;
std::shared_lock<std::shared_mutex> lock(mutex_);
triggerCurrentStateChangedCallbacks();
}

Expand All @@ -564,7 +564,7 @@ void Environment::setState(const std::vector<std::string>& joint_names,
currentStateChanged();
}

std::shared_lock<std::shared_mutex> lock;
std::shared_lock<std::shared_mutex> lock(mutex_);
triggerCurrentStateChangedCallbacks();
}

Expand Down Expand Up @@ -816,7 +816,7 @@ tesseract_collision::DiscreteContactManager::UPtr Environment::getDiscreteContac

void Environment::clearCachedDiscreteContactManager() const
{
std::shared_lock<std::shared_mutex> lock;
std::shared_lock<std::shared_mutex> lock(mutex_);
std::unique_lock<std::shared_mutex> discrete_lock(discrete_manager_mutex_);
discrete_manager_ = nullptr;
}
Expand Down

0 comments on commit 49c9497

Please sign in to comment.