diff options
author | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-12-27 07:33:22 +0000 |
---|---|---|
committer | bryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-12-27 07:33:22 +0000 |
commit | 9f3113e8a7b81eb35512df22ad15046b6d0ede75 (patch) | |
tree | be4fcec41f3123d4c6af6ca30cb64b2558a921dd /libjava | |
parent | 0c4e40c5032e78bc99d55092f105582b3aee4681 (diff) |
Commit forgotten Thread.java patch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31094 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/java/lang/Thread.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libjava/java/lang/Thread.java b/libjava/java/lang/Thread.java index 7d172433d06..b66fc2164b6 100644 --- a/libjava/java/lang/Thread.java +++ b/libjava/java/lang/Thread.java @@ -73,15 +73,15 @@ public class Thread implements Runnable public static boolean interrupted () { - return currentThread().isInterrupted(); + return currentThread().isInterrupted_(); } // FIXME: it seems to me that this should be synchronized. + // Check the threads interrupted status. Note that this does not clear the + // threads interrupted status (per JDK 1.2 online API documentation). public boolean isInterrupted () { - boolean r = interrupt_flag; - interrupt_flag = false; - return r; + return interrupt_flag; } public final boolean isAlive () @@ -112,6 +112,15 @@ public class Thread implements Runnable // This method exists only to avoid a warning from the C++ compiler. private static final native void run__ (Object obj); private native final void finish_ (); + + // Convenience method to check and clear the thread's interrupted status. + private boolean isInterrupted_ () + { + boolean r = interrupt_flag; + interrupt_flag = false; + return r; + } + private final void run_ () { try |