diff options
author | Bryce McKinlay <bryce@albatross.co.nz> | 1999-06-14 17:20:35 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 1999-06-14 18:20:35 +0100 |
commit | 00af55a292aa54527f86b41cf8c2c163f138d591 (patch) | |
tree | 7b1441ff5919725010048028526b1eafa85f21c1 /libjava/posix-threads.cc | |
parent | 8576f0942e3b46cb72409e5a487230d9c8c5c5ec (diff) | |
download | gcc-00af55a292aa54527f86b41cf8c2c163f138d591.zip gcc-00af55a292aa54527f86b41cf8c2c163f138d591.tar.gz gcc-00af55a292aa54527f86b41cf8c2c163f138d591.tar.bz2 |
* posix-threads.cc (_Jv_CondWait): Fix currentTimeMillis() overflow.
From-SVN: r27524
Diffstat (limited to 'libjava/posix-threads.cc')
-rw-r--r-- | libjava/posix-threads.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libjava/posix-threads.cc b/libjava/posix-threads.cc index 436588a..825b020 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; |