aboutsummaryrefslogtreecommitdiff
path: root/objectivec/GPBMessage_PackagePrivate.h
diff options
context:
space:
mode:
authorThomas Van Lenten <thomasvl@google.com>2018-01-31 15:57:30 -0500
committerThomas Van Lenten <thomasvl@google.com>2018-01-31 16:57:53 -0500
commitcf016a42e645a0aea2ce0d1027e210157c49016c (patch)
treec0c230df3f080cf54602d1e2040248a06d01e525 /objectivec/GPBMessage_PackagePrivate.h
parentd570d48648503e57f3abfcd9b9516583768fec48 (diff)
downloadprotobuf-cf016a42e645a0aea2ce0d1027e210157c49016c.tar.gz
protobuf-cf016a42e645a0aea2ce0d1027e210157c49016c.tar.bz2
protobuf-cf016a42e645a0aea2ce0d1027e210157c49016c.zip
Work around strange error with atomic and swift under Xcode 8.3.3.
Haven't been able to make a repo case, but this should "fix" the problem by avoid it completely. - Move readOnlySemaphore_ into the .m file so it isn't exposed in any header. - Move GPBGetObjectIvarWithField() also to go with the new limited visibility on the readOnlySemaphore_.
Diffstat (limited to 'objectivec/GPBMessage_PackagePrivate.h')
-rw-r--r--objectivec/GPBMessage_PackagePrivate.h14
1 files changed, 0 insertions, 14 deletions
diff --git a/objectivec/GPBMessage_PackagePrivate.h b/objectivec/GPBMessage_PackagePrivate.h
index 366e5bbf..ca10983b 100644
--- a/objectivec/GPBMessage_PackagePrivate.h
+++ b/objectivec/GPBMessage_PackagePrivate.h
@@ -61,20 +61,6 @@ typedef struct GPBMessage_Storage *GPBMessage_StoragePtr;
// GPBMessage_Storage with _has_storage__ as the first field.
// Kept public because static functions need to access it.
GPBMessage_StoragePtr messageStorage_;
-
- // A lock to provide mutual exclusion from internal data that can be modified
- // 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.
- // 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
- // Use of readOnlySemaphore_ must be prefaced by a call to
- // GPBPrepareReadOnlySemaphore to ensure it has been created. This allows
- // readOnlySemaphore_ to be only created when actually needed.
- _Atomic(dispatch_semaphore_t) readOnlySemaphore_;
}
// Gets an extension value without autocreating the result if not found. (i.e.