Why do we pass self in @synchronized block?
问题 I guess @synchronized blocks are not object dependent but thread dependent...right? In that case why do we pass self? 回答1: @synchronized is a construct provided by the language to create synchronized scopes. As it would be highly inefficient to use a simple global shared mutex, and thus serializing every single @synchronized scope in the application, the language allows us to specify a synchronization point. Then it's up to the developer(s) to decide which synchronization points are