re PR libgcj/22211 ([4.0 only] Thread.interrupt sometimes causes abort if thread is already dead)

PR libgcj/22211:
	* testsuite/libjava.lang/pr22211.java: New file.
	* java/lang/natThread.cc (finish_): Synchronize when updating
	alive_flag.
	(_Jv_AttachCurrentThread): Likewise.
	(interrupt): Only call _Jv_ThreadInterrupt if thread is alive.
	* java/lang/Thread.java (isAlive): Now synchronized.

From-SVN: r101430
This commit is contained in:
Tom Tromey 2005-06-29 17:36:16 +00:00 committed by Tom Tromey
parent 9fb93f8966
commit 3af9ac15a9
4 changed files with 30 additions and 4 deletions

View file

@ -550,7 +550,7 @@ public class Thread implements Runnable
*
* @return whether this Thread is alive
*/
public final boolean isAlive()
public final synchronized boolean isAlive()
{
return alive_flag;
}