Skip to content

Instantly share code, notes, and snippets.

@mNantern
Last active December 22, 2015 02:48
Show Gist options
  • Select an option

  • Save mNantern/6405397 to your computer and use it in GitHub Desktop.

Select an option

Save mNantern/6405397 to your computer and use it in GitHub Desktop.
public class ThreadLocalCache
{
private static volatile 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