Browse Source

More ripping out of old condition stuff.

Adam Ierymenko 11 years ago
parent
commit
91fef21973
2 changed files with 6 additions and 6 deletions
  1. 5 5
      node/Node.cpp
  2. 1 1
      node/Switch.cpp

+ 5 - 5
node/Node.cpp

@@ -56,7 +56,7 @@
 
 #include "Node.hpp"
 #include "Topology.hpp"
-#include "Demarc.hpp"
+#include "SocketManager.hpp"
 #include "Packet.hpp"
 #include "Switch.hpp"
 #include "Utils.hpp"
@@ -242,7 +242,7 @@ struct _NodeImpl
 		delete renv.nc;
 		delete renv.sysEnv;
 		delete renv.topology;
-		delete renv.demarc;
+		delete renv.sm;
 		delete renv.sw;
 		delete renv.mc;
 		delete renv.prng;
@@ -634,7 +634,7 @@ Node::ReasonForTermination Node::run()
 			try {
 				unsigned long delay = std::min((unsigned long)ZT_MIN_SERVICE_LOOP_INTERVAL,_r->sw->doTimerTasks());
 				uint64_t start = Utils::now();
-				_r->mainLoopWaitCondition.wait(delay);
+				_r->sm->poll(delay);
 				lastDelayDelta = (long)(Utils::now() - start) - (long)delay; // used to detect sleep/wake
 			} catch (std::exception &exc) {
 				LOG("unexpected exception running Switch doTimerTasks: %s",exc.what());
@@ -663,14 +663,14 @@ void Node::terminate(ReasonForTermination reason,const char *reasonText)
 {
 	((_NodeImpl *)_impl)->reasonForTermination = reason;
 	((_NodeImpl *)_impl)->reasonForTerminationStr = ((reasonText) ? reasonText : "");
-	((_NodeImpl *)_impl)->renv.mainLoopWaitCondition.signal();
+	((_NodeImpl *)_impl)->renv.sw->whack();
 }
 
 void Node::resync()
 	throw()
 {
 	((_NodeImpl *)_impl)->resynchronize = true;
-	((_NodeImpl *)_impl)->renv.mainLoopWaitCondition.signal();
+	((_NodeImpl *)_impl)->renv.sw->whack();
 }
 
 class _VersionStringMaker

+ 1 - 1
node/Switch.cpp

@@ -321,7 +321,7 @@ void Switch::contact(const SharedPtr<Peer> &peer,const InetAddress &atAddr)
 
 	// Kick main loop out of wait so that it can pick up this
 	// change to our scheduled timer tasks.
-	_r->mainLoopWaitCondition.signal();
+	_r->sm->whack();
 }
 
 unsigned long Switch::doTimerTasks()