fix Thread.interrupt and Thread.interrupted

These were both totally broken; the latter wasn't even implemented.
This commit fixes/implements them and adds a simple test to exercise
them.
This commit is contained in:
Joel Dice
2011-07-12 14:15:43 -06:00
parent ab8e6cdc80
commit c3fa08c430
7 changed files with 81 additions and 10 deletions

View File

@ -139,9 +139,17 @@ public class Thread implements Runnable {
public static native Thread currentThread();
public native void interrupt();
public void interrupt() {
interrupt(peer);
}
public native boolean interrupted();
private static native boolean interrupt(long peer);
public boolean interrupted() {
return interrupted(peer);
}
private static native boolean interrupted(long peer);
public static boolean isInterrupted() {
return currentThread().interrupted;