diff options
Diffstat (limited to 'objectivec/GPBMessage_PackagePrivate.h')
-rw-r--r-- | objectivec/GPBMessage_PackagePrivate.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/objectivec/GPBMessage_PackagePrivate.h b/objectivec/GPBMessage_PackagePrivate.h index d4c3501a..b7e24fc9 100644 --- a/objectivec/GPBMessage_PackagePrivate.h +++ b/objectivec/GPBMessage_PackagePrivate.h @@ -62,7 +62,12 @@ typedef struct GPBMessage_Storage *GPBMessage_StoragePtr; // by *read* operations such as getters (autocreation of message fields and // message extensions, not setting of values). Used to guarantee thread safety // for concurrent reads on the message. - OSSpinLock readOnlyMutex_; + // NOTE: OSSpinLock may seem like a good fit here but Apple engineers have + // pointed out that they are vulnerable to live locking on iOS in cases of + // priority inversion: + // http://mjtsai.com/blog/2015/12/16/osspinlock-is-unsafe/ + // https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000372.html + dispatch_semaphore_t readOnlySemaphore_; } // Gets an extension value without autocreating the result if not found. (i.e. |