barebones Java thread example with wait and notifyAll