Commit 212f5d30 by Tom Tromey Committed by Tom Tromey

natThread.cc (sleep): Turn 0 millis and 0 nanos into 1 nano.

	* java/lang/natThread.cc (sleep): Turn 0 millis and 0 nanos into 1
	nano.
	* include/quick-threads.h (_Jv_CondWait): Don't round to 0
	inappropriately.

From-SVN: r28742
parent 1b12a13e
1999-08-17 Tom Tromey <tromey@cygnus.com>
* java/lang/natThread.cc (sleep): Turn 0 millis and 0 nanos into 1
nano.
* include/quick-threads.h (_Jv_CondWait): Don't round to 0
inappropriately.
1999-08-16 Tom Tromey <tromey@cygnus.com>
* configure: Rebuilt.
......
......@@ -38,7 +38,11 @@ inline int
_Jv_CondWait (_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu,
jlong millis, jint nanos)
{
return coop_condition_variable_wait (cv, mu, millis * 1000 + nanos / 1000);
long micros = millis * 1000 + nanos / 1000;
// Don't round to 0 inappropriately.
if (! micros && (millis || nanos))
micros = 1;
return coop_condition_variable_wait (cv, mu, micros);
}
inline int
......
......@@ -214,6 +214,9 @@ java::lang::Thread::sleep (jlong millis, jint nanos)
if (millis < 0 || nanos < 0 || nanos > 999999)
_Jv_Throw (new IllegalArgumentException);
if (millis == 0 && nanos == 0)
++nanos;
Thread *current = currentThread ();
if (current->isInterrupted ())
_Jv_Throw (new InterruptedException);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment