public static void main(String[] args) throws InterruptedException {
    new Thread(new Runnable() {
      @Override
      public void run() {
        int i = 0;
        while (!isDone()){
          i++;
        }
        System.out.println("done!");
      }
    }).start();

    System.out.println("OS: " + System.getProperty("os.name"));
    Thread.sleep(2000);
    setDone(true);
    System.out.println("flag done set to true");
  }