public class User implements Serializable { private Object lock = new Object(); public void get(){ synchronized (lock){ } } } 查看完整描述