Last active
December 22, 2015 02:48
-
-
Save mNantern/6405389 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| public class ThreadLocalCache | |
| { | |
| private static boolean keepRunning = true; | |
| public static void main( String[] args ) throws InterruptedException | |
| { | |
| (new Thread(){ | |
| public void run() { | |
| while (keepRunning){ | |
| } | |
| } | |
| }).start(); | |
| System.out.println( keepRunning ); | |
| Thread.sleep(1000); | |
| keepRunning = false; | |
| System.out.println( keepRunning ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment