Use Thread.sleep() instead of wait() so no locks have to be acquired.