Thread.stop()

Jason Baker kaffe@rufus.w3.org
22 May 2000 16:29:47 -0600


Jason Baker <jbaker@cs.utah.edu> writes:

> Archie Cobbs <archie@whistle.com> writes:
> 
> > Email me a simple test case and I'll run it under both kaffe and JDK 1.2.
> 
> Weird.  Blackdown 1.2.2 doesn't seem to asynchronously stop threads at
> all, while jdk 1.1.7 can do it some of the time.  Neither one seems to
> throw an exception with a stack trace at all.
> 

Some of you where probably wondering what I found weird: I'm not
surprised that 1.2.2 doesn't handle asynchronous stops.  I am
surprised that synchronously delivered stop exceptions don't carry any
stack trace.  I'm also completely at a loss to explain when stop works
in 1.1.7.

Does anyone think that Thread.waitOn should emulate jdk behavior and
clear out the stack trace from a Thread.stop() exception before
throwing it?

Jason

> ------------------------------------------------------------------------------
> 1.2.2:
> nephi(53) java Die 
> sleeper started
> doing it...
> loop started
> caught an error
> java.lang.Error: throwing from main
> done
> doing it...
> ^C
> ------------------------------------------------------------------------------
> 1.1.7:
> nephi(57) java Die

wait 1 second before calling Thread.stop()

> sleeper started
> doing it...
> loop started
> caught an error
> java.lang.Error: throwing from main
> done
> doing it...
> ^C
> nephi(59) java Die 100

wait 0.1 seconds, but 0.8 works too.

> sleeper started
> doing it...
> loop started
> caught an error
> java.lang.Error: throwing from main
> done
> doing it...
> caught an error
> java.lang.Error: throwing from main
> done
> ------------------------------------------------------------------------------
> patched kaffe:
> sleeper starteddoing it...
> 
> loop started
> caught an error
> java.lang.Error: throwing from main
>         at java.lang.Thread.waitOn(Thread.java:475)
>         at java.lang.Thread.sleep(Thread.java:364)
>         at Die$1.doIt(Die.java:24)
>         at Die.run(Die.java:7)
> done
> doing it...
> caught an error
> java.lang.Error: throwing from main
>         at Die.run(Die.java:7)
> done