Wait and notify example from multithreading class.