aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-11-03 02:41:51 +0000
committerChristopher Faylor <me@cgf.cx>2005-11-03 02:41:51 +0000
commit369adcf72fc67642dd6e8ab882f46f97dd7fe0c7 (patch)
tree4f200f391b4ce9961f59337118ff4b9b87bcf025
parent1c2812f80e7ec1776c037f2f1f9eb3211c2a5d05 (diff)
downloadnewlib-369adcf72fc67642dd6e8ab882f46f97dd7fe0c7.zip
newlib-369adcf72fc67642dd6e8ab882f46f97dd7fe0c7.tar.gz
newlib-369adcf72fc67642dd6e8ab882f46f97dd7fe0c7.tar.bz2
* times.cc (hires_ms::minperiod): Make copy-on-fork.
(gettimeofday): Remove temporary debugging. (hires_us::prime): Add lots of temporary debugging output.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/times.cc18
2 files changed, 20 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d6181eb..46962ee 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
2005-11-02 Christopher Faylor <cgf@timesys.com>
+ * times.cc (hires_ms::minperiod): Make copy-on-fork.
+ (gettimeofday): Remove temporary debugging.
+ (hires_us::prime): Add lots of temporary debugging output.
+
+2005-11-02 Christopher Faylor <cgf@timesys.com>
+
* times.cc (gettimeofday): Add temporary debugging output.
2005-11-01 Christopher Faylor <cgf@timesys.com>
diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 0652a12..09cb3aa 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -144,17 +144,16 @@ totimeval (struct timeval *dst, FILETIME *src, int sub, int flag)
dst->tv_sec = x / (long long) (1e6);
}
-hires_ms gtod;
-UINT NO_COPY hires_ms::minperiod;
+hires_ms NO_COPY gtod;
+UINT hires_ms::minperiod;
/* FIXME: Make thread safe */
extern "C" int
gettimeofday (struct timeval *tv, struct timezone *tz)
{
static bool tzflag;
-debug_printf ("prior to gtod.usecs"); // DELETEME
LONGLONG now = gtod.usecs (false);
-debug_printf ("after to gtod.usecs"); // DELETEME
+
if (now == (LONGLONG) -1)
return -1;
@@ -562,24 +561,35 @@ void
hires_us::prime ()
{
LARGE_INTEGER ifreq;
+debug_printf ("before QueryPerformanceFrequency"); // DELETEME
if (!QueryPerformanceFrequency (&ifreq))
{
+debug_printf ("QueryPerformanceFrequency failed"); // DELETEME
inited = -1;
return;
}
+debug_printf ("after QueryPerformanceFrequency"); // DELETEME
FILETIME f;
int priority = GetThreadPriority (GetCurrentThread ());
+
+debug_printf ("before SetThreadPriority(THREAD_PRIORITY_TIME_CRITICAL)"); // DELETEME
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL);
+debug_printf ("after SetThreadPriority(THREAD_PRIORITY_TIME_CRITICAL)"); // DELETEME
if (!QueryPerformanceCounter (&primed_pc))
{
+debug_printf ("QueryPerformanceCounter failed, %E");
SetThreadPriority (GetCurrentThread (), priority);
+debug_printf ("After failing SetThreadPriority");
inited = -1;
return;
}
+debug_printf ("after QueryPerformanceCounter"); // DELETEME
GetSystemTimeAsFileTime (&f);
+debug_printf ("after GetSystemTimeAsFileTime"); // DELETEME
SetThreadPriority (GetCurrentThread (), priority);
+debug_printf ("after SetThreadPriority(%d)", priority); // DELETEME
inited = 1;
primed_ft.HighPart = f.dwHighDateTime;