Skip to content

Commit

Permalink
Merged in gazebo_3.1_fix_deadlock (pull request #1152)
Browse files Browse the repository at this point in the history
Fix deadlock for gazebo 3.1
  • Loading branch information
scpeters committed Jul 21, 2014
2 parents 0af6fbd + ae41a4f commit 8ca5af8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gazebo/physics/World.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ using namespace physics;
/// \brief Flag used to say if/when to clear all models.
/// This will be replaced with a class member variable in Gazebo 3.0
bool g_clearModels;
boost::mutex g_deprecatedMutexReplaceInGazebo4;

class ModelUpdate_TBB
{
Expand Down Expand Up @@ -1667,8 +1668,7 @@ void World::ProcessFactoryMsgs()
{
try
{
boost::recursive_mutex::scoped_lock lock(
*this->GetPhysicsEngine()->GetPhysicsUpdateMutex());
boost::mutex::scoped_lock lock(g_deprecatedMutexReplaceInGazebo4);

ModelPtr model = this->LoadModel(*iter2, this->rootElement);
model->Init();
Expand Down Expand Up @@ -2001,11 +2001,10 @@ uint32_t World::GetIterations() const
//////////////////////////////////////////////////
void World::RemoveModel(const std::string &_name)
{
boost::mutex::scoped_lock flock(g_deprecatedMutexReplaceInGazebo4);

// Remove all the dirty poses from the delete entity.
{
boost::recursive_mutex::scoped_lock lock(
*this->GetPhysicsEngine()->GetPhysicsUpdateMutex());

for (std::list<Entity*>::iterator iter2 = this->dirtyPoses.begin();
iter2 != this->dirtyPoses.end();)
{
Expand Down

0 comments on commit 8ca5af8

Please sign in to comment.