mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user