Commits

John Hsu  committed b670866

rename mutices to be more generic

  • Participants
  • Parent commits 32b7054
  • Branches fix_pause_reset

Comments (0)

Files changed (3)

File src/physics/Entity.cc

 //
 void Entity::SetWorldPose(const math::Pose &_pose, bool _notify)
 {
-  this->GetWorld()->modelWorldPoseUpdateMutex->lock();
+  this->GetWorld()->setWorldPoseMutex->lock();
 
   (*this.*setWorldPoseFunc)(_pose, _notify);
 
-  this->GetWorld()->modelWorldPoseUpdateMutex->unlock();
+  this->GetWorld()->setWorldPoseMutex->unlock();
 
   this->PublishPose();
 }
 //////////////////////////////////////////////////
 void Entity::Reset()
 {
-  this->GetWorld()->modelWorldPoseUpdateMutex->lock();
+  this->GetWorld()->setWorldPoseMutex->lock();
   Base::Reset();
 
   if (this->HasType(Base::MODEL))
     this->SetWorldPose(this->initialRelativePose);
   else
     this->SetRelativePose(this->initialRelativePose);
-  this->GetWorld()->modelWorldPoseUpdateMutex->unlock();
+  this->GetWorld()->setWorldPoseMutex->unlock();
 }
 
 //////////////////////////////////////////////////

File src/physics/World.cc

 
   this->name = _name;
 
-  this->modelWorldPoseUpdateMutex = new boost::recursive_mutex();
-  this->pauseMutex = new boost::recursive_mutex();
+  this->setWorldPoseMutex = new boost::recursive_mutex();
+  this->worldUpdateMutex = new boost::recursive_mutex();
 
   this->connections.push_back(
      event::Events::ConnectStep(boost::bind(&World::OnStep, this)));
 //////////////////////////////////////////////////
 World::~World()
 {
-  delete this->modelWorldPoseUpdateMutex;
-  this->modelWorldPoseUpdateMutex = NULL;
-  delete this->pauseMutex;
-  this->pauseMutex = NULL;
+  delete this->setWorldPoseMutex;
+  this->setWorldPoseMutex = NULL;
+  delete this->worldUpdateMutex;
+  this->worldUpdateMutex = NULL;
 
   this->connections.clear();
   this->Fini();
   common::Time prevUpdateTime = common::Time::GetWallTime();
   while (!this->stop)
   {
-    this->pauseMutex->lock();
+    this->worldUpdateMutex->lock();
     // Send statistics about the world simulation
     if (common::Time::GetWallTime() - this->prevStatTime > this->statPeriod)
     {
     this->ProcessRequestMsgs();
     this->ProcessFactoryMsgs();
     this->ProcessModelMsgs();
-    this->pauseMutex->unlock();
+    this->worldUpdateMutex->unlock();
   }
 }
 
 
   event::Events::pause(_p);
 
-  this->pauseMutex->lock();
+  this->worldUpdateMutex->lock();
   this->pause = _p;
-  this->pauseMutex->unlock();
+  this->worldUpdateMutex->unlock();
 }
 
 

File src/physics/World.hh

 
       /// TODO: Add an accessor for this, and make it private
       /// lock all pose updates when worldPose is being updated for a model
-      public: boost::recursive_mutex *modelWorldPoseUpdateMutex;
-      public: boost::recursive_mutex *pauseMutex;
+      public: boost::recursive_mutex *setWorldPoseMutex;
+      public: boost::recursive_mutex *worldUpdateMutex;
 
       private: sdf::ElementPtr sdf;