Objects declared inside a method staticare not shared between threads. Objects defined outside the method as staticare common.
So:
private static Object thisIsShared;
public static void myMethod() {
Object thisIsNotShared = new Object();
}
If you are going to name interrupt()for threads running I / O, you should look at using classes that implement the interfaceInterruptableChannel .