/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This source file is part of SableVM. * * * * See the file "LICENSE" for the copyright information and for * * the terms and conditions for copying, distribution and * * modification of this source file. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ public class Lock implements Runnable { private static Object lock = new Object(); private static volatile boolean done = false; public static void main(String[] args) throws Throwable { synchronized(lock) { Thread t = new Thread(new Lock()); t.start(); while(!done); } } public void run() { System.out.println("hash code = " + lock.hashCode()); done = true; } }