Among the different methods of a class, all methods share a semaphore.
Adding synchronized modification to two different methods means that the two methods share a lock, that is, a semaphore. In this way, the two methods with synchronized can be mutually exclusive!