浏览代码

ClockObject has moved to putil

David Rose 20 年之前
父节点
当前提交
ac764876e4
共有 3 个文件被更改,包括 13 次插入13 次删除
  1. 6 6
      panda/src/net/connection.cxx
  2. 4 4
      panda/src/net/connectionReader.cxx
  3. 3 3
      panda/src/net/queuedConnectionReader.cxx

+ 6 - 6
panda/src/net/connection.cxx

@@ -24,7 +24,7 @@
 #include "pprerror.h"
 #include "pprerror.h"
 #include "config_net.h"
 #include "config_net.h"
 #include "config_express.h" // for collect_tcp
 #include "config_express.h" // for collect_tcp
-#include "clockObject.h"
+#include "trueClock.h"
 #include "pnotify.h"
 #include "pnotify.h"
 
 
 
 
@@ -189,7 +189,7 @@ consider_flush() {
 
 
   } else {
   } else {
     double elapsed = 
     double elapsed = 
-      ClockObject::get_global_clock()->get_real_time() - _queued_data_start;
+      TrueClock::get_global_ptr()->get_short_time() - _queued_data_start;
     // If the elapsed time is negative, someone must have reset the
     // If the elapsed time is negative, someone must have reset the
     // clock back, so just go ahead and flush.
     // clock back, so just go ahead and flush.
     if (elapsed < 0.0 || elapsed >= _collect_tcp_interval) {
     if (elapsed < 0.0 || elapsed >= _collect_tcp_interval) {
@@ -413,7 +413,7 @@ send_datagram(const NetDatagram &datagram, int tcp_header_size) {
   }
   }
 
 
   if (!_collect_tcp || 
   if (!_collect_tcp || 
-      ClockObject::get_global_clock()->get_real_time() - _queued_data_start >= _collect_tcp_interval) {
+      TrueClock::get_global_ptr()->get_short_time() - _queued_data_start >= _collect_tcp_interval) {
     return do_flush();
     return do_flush();
   }
   }
 
 
@@ -464,7 +464,7 @@ send_raw_datagram(const NetDatagram &datagram) {
   _queued_count++;
   _queued_count++;
 
 
   if (!_collect_tcp || 
   if (!_collect_tcp || 
-      ClockObject::get_global_clock()->get_real_time() - _queued_data_start >= _collect_tcp_interval) {
+      TrueClock::get_global_ptr()->get_short_time() - _queued_data_start >= _collect_tcp_interval) {
     return do_flush();
     return do_flush();
   }
   }
 
 
@@ -484,7 +484,7 @@ do_flush() {
   PRInt32 bytes_to_send = _queued_data.length();
   PRInt32 bytes_to_send = _queued_data.length();
   if (bytes_to_send == 0) {
   if (bytes_to_send == 0) {
     _queued_count = 0;
     _queued_count = 0;
-    _queued_data_start = ClockObject::get_global_clock()->get_real_time();
+    _queued_data_start = TrueClock::get_global_ptr()->get_short_time();
     PR_Unlock(_write_mutex);
     PR_Unlock(_write_mutex);
     return true;
     return true;
   }
   }
@@ -504,7 +504,7 @@ do_flush() {
 
 
   _queued_data = string();
   _queued_data = string();
   _queued_count = 0;
   _queued_count = 0;
-  _queued_data_start = ClockObject::get_global_clock()->get_real_time();
+  _queued_data_start = TrueClock::get_global_ptr()->get_short_time();
 
 
   PR_Unlock(_write_mutex);
   PR_Unlock(_write_mutex);
 
 

+ 4 - 4
panda/src/net/connectionReader.cxx

@@ -23,7 +23,7 @@
 #include "datagramUDPHeader.h"
 #include "datagramUDPHeader.h"
 #include "pprerror.h"
 #include "pprerror.h"
 #include "config_net.h"
 #include "config_net.h"
-#include "clockObject.h"
+#include "trueClock.h"
 
 
 #include "pnotify.h"
 #include "pnotify.h"
 #include <prerror.h>
 #include <prerror.h>
@@ -311,12 +311,12 @@ poll() {
 
 
     } else {
     } else {
       // Read only until a certain amount of time has elapsed.
       // Read only until a certain amount of time has elapsed.
-      ClockObject *global_clock = ClockObject::get_global_clock();
-      double stop = global_clock->get_real_time() + max_poll_cycle;
+      TrueClock *global_clock = TrueClock::get_global_ptr();
+      double stop = global_clock->get_short_time() + max_poll_cycle;
 
 
       while (sinfo != (SocketInfo *)NULL) {
       while (sinfo != (SocketInfo *)NULL) {
 	process_incoming_data(sinfo);
 	process_incoming_data(sinfo);
-	if (global_clock->get_real_time() >= stop) {
+	if (global_clock->get_short_time() >= stop) {
 	  return;
 	  return;
 	}
 	}
 	sinfo = get_next_available_socket(PR_INTERVAL_NO_WAIT, -2);
 	sinfo = get_next_available_socket(PR_INTERVAL_NO_WAIT, -2);

+ 3 - 3
panda/src/net/queuedConnectionReader.cxx

@@ -18,7 +18,7 @@
 
 
 #include "queuedConnectionReader.h"
 #include "queuedConnectionReader.h"
 #include "config_net.h"
 #include "config_net.h"
-#include "clockObject.h"
+#include "trueClock.h"
 
 
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: QueuedConnectionReader::Constructor
 //     Function: QueuedConnectionReader::Constructor
@@ -192,7 +192,7 @@ void QueuedConnectionReader::
 get_delayed() {
 get_delayed() {
   if (_delay_active) {
   if (_delay_active) {
     PR_Lock(_dd_mutex);
     PR_Lock(_dd_mutex);
-    double now = ClockObject::get_global_clock()->get_frame_time();
+    double now = TrueClock::get_global_ptr()->get_short_time();
     while (!_delayed.empty()) {
     while (!_delayed.empty()) {
       const DelayedDatagram &dd = _delayed.front();
       const DelayedDatagram &dd = _delayed.front();
       if (dd._reveal_time > now) {
       if (dd._reveal_time > now) {
@@ -233,7 +233,7 @@ delay_datagram(const NetDatagram &datagram) {
       }
       }
 
 
     } else {
     } else {
-      double now = ClockObject::get_global_clock()->get_frame_time();
+      double now = TrueClock::get_global_ptr()->get_short_time();
       double reveal_time = now + _min_delay;
       double reveal_time = now + _min_delay;
       
       
       if (_delay_variance > 0.0) {
       if (_delay_variance > 0.0) {