Created
November 9, 2014 11:12
-
-
Save neuro-sys/f8af6e3164c40ab2abc0 to your computer and use it in GitHub Desktop.
patriciding_thread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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