I meet this code:
@synchronized (self.messageQueue) {
[self.messageQueue insertObject:messageDictionaryRepresentation atIndex:0];
}
I want to ask for help what this syntax(@synchronized) use for? Thanks.
I meet this code:
@synchronized (self.messageQueue) {
[self.messageQueue insertObject:messageDictionaryRepresentation atIndex:0];
}
I want to ask for help what this syntax(@synchronized) use for? Thanks.
See Synchronization. You find that is "a convenient way to create mutex locks on the fly in Objective-C code". a related question is What does @synchronized() do?.