ClockObject has moved to putil

This commit is contained in:
David Rose 2006-03-29 00:25:47 +00:00
parent 0e3f5c068a
commit ac764876e4
3 changed files with 13 additions and 13 deletions

View File

@ -24,7 +24,7 @@
#include "pprerror.h"
#include "config_net.h"
#include "config_express.h" // for collect_tcp
#include "clockObject.h"
#include "trueClock.h"
#include "pnotify.h"
@ -189,7 +189,7 @@ consider_flush() {
} else {
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
// clock back, so just go ahead and flush.
if (elapsed < 0.0 || elapsed >= _collect_tcp_interval) {
@ -413,7 +413,7 @@ send_datagram(const NetDatagram &datagram, int tcp_header_size) {
}
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();
}
@ -464,7 +464,7 @@ send_raw_datagram(const NetDatagram &datagram) {
_queued_count++;
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();
}
@ -484,7 +484,7 @@ do_flush() {
PRInt32 bytes_to_send = _queued_data.length();
if (bytes_to_send == 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);
return true;
}
@ -504,7 +504,7 @@ do_flush() {
_queued_data = string();
_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);

View File

@ -23,7 +23,7 @@
#include "datagramUDPHeader.h"
#include "pprerror.h"
#include "config_net.h"
#include "clockObject.h"
#include "trueClock.h"
#include "pnotify.h"
#include <prerror.h>
@ -311,12 +311,12 @@ poll() {
} else {
// 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) {
process_incoming_data(sinfo);
if (global_clock->get_real_time() >= stop) {
if (global_clock->get_short_time() >= stop) {
return;
}
sinfo = get_next_available_socket(PR_INTERVAL_NO_WAIT, -2);

View File

@ -18,7 +18,7 @@
#include "queuedConnectionReader.h"
#include "config_net.h"
#include "clockObject.h"
#include "trueClock.h"
////////////////////////////////////////////////////////////////////
// Function: QueuedConnectionReader::Constructor
@ -192,7 +192,7 @@ void QueuedConnectionReader::
get_delayed() {
if (_delay_active) {
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()) {
const DelayedDatagram &dd = _delayed.front();
if (dd._reveal_time > now) {
@ -233,7 +233,7 @@ delay_datagram(const NetDatagram &datagram) {
}
} 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;
if (_delay_variance > 0.0) {