diff options
Diffstat (limited to 'objectivec/GPBUtilities.m')
-rw-r--r-- | objectivec/GPBUtilities.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/objectivec/GPBUtilities.m b/objectivec/GPBUtilities.m index 5ee61230..eaa28bbc 100644 --- a/objectivec/GPBUtilities.m +++ b/objectivec/GPBUtilities.m @@ -411,7 +411,7 @@ id GPBGetObjectIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { return field.defaultValue.valueMessage; } - OSSpinLockLock(&self->readOnlyMutex_); + dispatch_semaphore_wait(self->readOnlySemaphore_, DISPATCH_TIME_FOREVER); GPBMessage *result = GPBGetObjectIvarWithFieldNoAutocreate(self, field); if (!result) { // For non repeated messages, create the object, set it and return it. @@ -420,7 +420,7 @@ id GPBGetObjectIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { result = GPBCreateMessageWithAutocreator(field.msgClass, self, field); GPBSetAutocreatedRetainedObjectIvarWithField(self, field, result); } - OSSpinLockUnlock(&self->readOnlyMutex_); + dispatch_semaphore_signal(self->readOnlySemaphore_); return result; } |