This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Thread.setDaemon() patch
- From: Mark Wielaard <mark at klomp dot org>
- To: java-patches at gcc dot gnu dot org
- Date: 06 Oct 2002 00:08:52 +0200
- Subject: Thread.setDaemon() patch
Hi,
Here is a small patch that fixes a corner case in setDaemon(). You may
not call setDaemon() after the Thread is started even when it is already
finished and not alive anymore.
2002-10-06 Mark Wielaard <mark@klomp.org>
* java/lang/Thread.java (setDaemon): Check startable_flag,
not isAlive().
OK to commit?
Cheers,
Mark
--- java/lang/Thread.java 29 Aug 2002 17:53:28 -0000 1.23
+++ java/lang/Thread.java 5 Oct 2002 21:50:51 -0000
@@ -137,7 +137,7 @@
public final void setDaemon (boolean status)
{
checkAccess ();
- if (isAlive ())
+ if (!startable_flag)
throw new IllegalThreadStateException ();
daemon_flag = status;
}