重构synchronized block