bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/22670] Should Thread.stop() call ThreadGroup.removeThread


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/22670] Should Thread.stop() call ThreadGroup.removeThread().?
Date: 16 Oct 2005 01:26:27 -0000

Near the end of Thread.stop(), it calls:

  group.removeThread(this);

Since the VM is going to do this anyway when the
thread exits, this seems at best redundant.

Moreover, in the pathological case where the thread
actually catches ThreadDeath and then keeps doing
stuff, this is not just redundant but also wrong,
because the thread hasn't died yet, but it won't be
in its ThreadGroup anymore.

So this line should be removed.


------- Comment #1 from from-classpath at savannah dot gnu dot org  2003-03-25 
19:02 -------
No it most definitely should not call removeThread.

Thye action of stop is quite simply to throw an asynchronous exception in the
thread. That exception is processed as normal and if not caught then the normal
uncaught exception mechanics will perform a normal thread termination. Until
that time the thread is very much alive and is quite free to catch and ignore
the stop() request.


------- Comment #2 from from-classpath at savannah dot gnu dot org  2003-07-27 
04:05 -------
I have included a potential Mauve test, but I'm having trouble getting the JDK
to prove to me the test is correct.  ThreadDeath is never seen in the instance
of the 'stop' thread.


------- Comment #3 from from-classpath at savannah dot gnu dot org  2003-07-29 
11:40 -------
Removed the offending call and have added a Mauve test case.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22670





reply via email to

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