Skip to content

Instantly share code, notes, and snippets.

@neuro-sys
Created November 9, 2014 11:12
Show Gist options
  • Save neuro-sys/f8af6e3164c40ab2abc0 to your computer and use it in GitHub Desktop.
Save neuro-sys/f8af6e3164c40ab2abc0 to your computer and use it in GitHub Desktop.
patriciding_thread
new Thread(new Runnable() {
Thread parentThread;
public Runnable init(Thread t) {
parentThread = t;
return this;
}
public void run() {
try {
Thread.sleep(90 * 1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
parentThread.interrupt();
}
}.init(Thread.currentThread())).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment