set() { System.out.println(Thread.currentThread().getName() + ": flag: notification sent"); flag = true; notifyAll(); }
synchronized void set() { Thread current = Thread.currentThread(); String name = current instanceof Task ? ((Task)current).getTaskName() : "Main "; System.out.println(name + ": flag: notification sent"); flag = true; notifyAll(); }
   set()      {      System.out.println(Thread.currentThread().getName() + ": flag: notification sent");      flag = true;      notifyAll();      }