[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Implementing Thread.sleep() via Thread.wait()

From: Mark Wielaard
Subject: Re: [cp-patches] Implementing Thread.sleep() via Thread.wait()
Date: Sun, 02 Jan 2005 18:57:36 +0100


On Sun, 2005-01-02 at 11:29 -0600, Archie Cobbs wrote:
> Hmm.. how about this: since there are two separate issues here,
> let's separate them.
> Issue #1 is adding the non-native VMThread.sleep() implementation,
> which is not a problem for anyone.

It would have automatically made sleep(0) do "the right thing" for those
runtimes that had implemented sleep(0) as (wrongly) described in our
documentation as sleeping indefinitely. But I assume most runtimes will
fix this anyway given time. So I don't have a problem with not doing
this in VMThread.sleep().

Some people disagree about the wanted semantics of this method and want
to provide alternative implementations. This allows them to do so.

> Issue #2 is changing Thread.sleep(0) from testing for interrupt to
> just doing Thread.yield().
> My commit mixed #1 and #2, so for now I'll revert the #2 part, leaving
> only the #1 part.
> Then we can continue to decide what to do about #2. The net result is
> that for the time being the behavior will be same it was before the new
> VMThread.sleep() implementation, i.e., test for interrupted status.

Fine with me. Again my main objective is making sure our implementation,
documentation and mauve tests agree about the wanted semantics of this
method. If you revert the implementation to having Thread.sleep() always
check the interrupted state then all three are in sync again.



Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]