[Orxonox-commit 776] r3303 - branches/netp6/src/network

scheusso at orxonox.net scheusso at orxonox.net
Sat Jul 18 17:28:24 CEST 2009


Author: scheusso
Date: 2009-07-18 17:28:24 +0200 (Sat, 18 Jul 2009)
New Revision: 3303

Modified:
   branches/netp6/src/network/GamestateManager.cc
   branches/netp6/src/network/GamestateManager.h
Log:
reverted some changes, which made the network multithreaded, in order to make a 0.0.3 tag


Modified: branches/netp6/src/network/GamestateManager.cc
===================================================================
--- branches/netp6/src/network/GamestateManager.cc	2009-07-18 15:13:38 UTC (rev 3302)
+++ branches/netp6/src/network/GamestateManager.cc	2009-07-18 15:28:24 UTC (rev 3303)
@@ -42,7 +42,7 @@
 
 #include <cassert>
 #include <queue>
-#include <boost/thread/mutex.hpp>
+// #include <boost/thread/mutex.hpp>
 
 #include "util/Debug.h"
 #include "core/Executor.h"
@@ -59,8 +59,8 @@
   reference(0), id_(0)
   {
     trafficControl_ = new TrafficControl();
-    threadMutex_ = new boost::mutex();
-    threadPool_ = new ThreadPool();
+//     threadMutex_ = new boost::mutex();
+//     threadPool_ = new ThreadPool();
   }
 
   GamestateManager::~GamestateManager()
@@ -77,8 +77,8 @@
         delete (*it2).second;
     }
     delete this->trafficControl_;
-    delete this->threadMutex_;
-    delete this->threadPool_;
+//     delete this->threadMutex_;
+//     delete this->threadPool_;
   }
 
   bool GamestateManager::update(){
@@ -157,19 +157,19 @@
       }
       
       clientGamestates.push(0);
-//       finishGamestate( cid, clientGamestates.back(), client, reference );
+      finishGamestate( cid, &clientGamestates.back(), client, reference );
       //FunctorMember<GamestateManager>* functor = 
-      ExecutorMember<GamestateManager>* executor = createExecutor( createFunctor(&GamestateManager::finishGamestate) );
-      executor->setObject(this);
-      executor->setDefaultValues( cid, &clientGamestates.back(), client, reference );
+//       ExecutorMember<GamestateManager>* executor = createExecutor( createFunctor(&GamestateManager::finishGamestate) );
+//       executor->setObject(this);
+//       executor->setDefaultValues( cid, &clientGamestates.back(), client, reference );
 //       (*static_cast<Executor*>(executor))();
-      this->threadPool_->passFunction( executor, true );
+//       this->threadPool_->passFunction( executor, true );
 //       (*functor)( cid, &(clientGamestates.back()), client, reference );
       
       temp = temp->next();
     }
     
-    threadPool_->synchronise();
+//     threadPool_->synchronise();
     
     while( !clientGamestates.empty() )
     {
@@ -190,9 +190,9 @@
 //     packet::Gamestate *gs = new packet::Gamestate(*gamestate);
 //     packet::Gamestate *gs = new packet::Gamestate();
 //     gs->collectData( id_, 0x1 );
-    this->threadMutex_->lock();
+//     this->threadMutex_->lock();
     gamestateMap_[clientID][gamestate->getID()]=gs;
-    this->threadMutex_->unlock();
+//     this->threadMutex_->unlock();
     
     if(base)
     {

Modified: branches/netp6/src/network/GamestateManager.h
===================================================================
--- branches/netp6/src/network/GamestateManager.h	2009-07-18 15:13:38 UTC (rev 3302)
+++ branches/netp6/src/network/GamestateManager.h	2009-07-18 15:28:24 UTC (rev 3303)
@@ -89,8 +89,8 @@
     packet::Gamestate *reference;
     TrafficControl *trafficControl_;
     unsigned int id_;
-    boost::mutex* threadMutex_;
-    ThreadPool*   threadPool_;
+//     boost::mutex* threadMutex_;
+    ThreadPool*   /*thread*/Pool_;
   };
 
 }




More information about the Orxonox-commit mailing list