Ejemplo n.º 1
0
 public static void main(String[] args) {
   SynchronizedObject object = new SynchronizedObject();
   object.setValue(1);
   Thread t = new Thread(new ProcessingThread(object));
   t.start();
   try {
     Thread.sleep(1000);
   } catch (InterruptedException ex) {
     System.err.println("main::Interrupted: " + ex.getMessage());
   }
   log("main::Setting value");
   object.setValue(2);
   log("main::Value set");
 }
Ejemplo n.º 2
0
 public void run() {
   object.process();
 }