From 00af55a292aa54527f86b41cf8c2c163f138d591 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Mon, 14 Jun 1999 17:20:35 +0000 Subject: [PATCH] * posix-threads.cc (_Jv_CondWait): Fix currentTimeMillis() overflow. From-SVN: r27524 --- libjava/ChangeLog | 7 ++++++- libjava/posix-threads.cc | 11 +++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 5fa114912df..42bec98ff0e 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,8 +1,13 @@ +1999-06-14 Bryce McKinlay + + * posix-threads.cc (_Jv_CondWait): Fix currentTimeMillis() overflow. + 1999-06-11 Warren Levy * mauve-libgcj: Activated java.net Mauve tests. 1999-06-10 Bryce McKinlay + * java/net/natInetAddress.cc (aton): Fix typos. (lookup): Use a bigger buffer size for gethostbyname_r on all versions of glibc. Updated FIXME comment explaining this. @@ -22,7 +27,7 @@ * java/text/DecimalFormat.java: Throw IllegalArgumentException throughout rather than ParseException. -1999-06-09 Bryce McKinlay +1999-06-09 Bryce McKinlay * java/lang/Runtime.java (exec): Convert prog name and arguments to string array. diff --git a/libjava/posix-threads.cc b/libjava/posix-threads.cc index 436588aee32..825b0206c19 100644 --- a/libjava/posix-threads.cc +++ b/libjava/posix-threads.cc @@ -85,12 +85,11 @@ _Jv_CondWait (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, r = pthread_cond_wait (cv, pmu); else { - struct timespec ts; - unsigned long m = millis + java::lang::System::currentTimeMillis (); - - ts.tv_sec = m / 1000; - ts.tv_nsec = (m % 1000) * 1000 * 1000 + nanos; - + struct timespec ts; + jlong m = millis + java::lang::System::currentTimeMillis (); + ts.tv_sec = m / 1000; + ts.tv_nsec = ((m % 1000) * 1000000) + nanos; + r = pthread_cond_timedwait (cv, pmu, &ts); } return r;