summarize the java synchronized mechanism