Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2015-04-29 20:24:56 +0300
committerDavid Benjamin <davidben@google.com>2015-04-29 23:47:07 +0300
commit68de407b5fc746c0fa82706dd897288d01c32930 (patch)
treeb1f4f9f5faefa6957597393c35d0a9e4cc7d924f /crypto/internal.h
parentd33908e8d66db1ccaf6b27fd5e3c7d3fc1449cc1 (diff)
Work around missing PTHREAD_RWLOCK_INITIALIZER in NaCl newlib.
This can be removed once NaCl is fixed and the fix rolls into Chromium. See https://code.google.com/p/nativeclient/issues/detail?id=4160 See https://codereview.chromium.org/951583004/diff/60001/src/untrusted/pthread/pthread.h#pair-132 https://codereview.chromium.org/951583004/diff/60001/src/untrusted/pthread/nc_rwlock.c#pair-48 Change-Id: I21e6d97b24c17f21aa97ee0f71d374400455c441 Reviewed-on: https://boringssl-review.googlesource.com/4590 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/internal.h')
-rw-r--r--crypto/internal.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/crypto/internal.h b/crypto/internal.h
index 9cb8573c..40fcf90a 100644
--- a/crypto/internal.h
+++ b/crypto/internal.h
@@ -369,7 +369,19 @@ OPENSSL_EXPORT void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void));
struct CRYPTO_STATIC_MUTEX {
pthread_rwlock_t lock;
};
+
+#if !defined(PTHREAD_RWLOCK_INITIALIZER) && defined(__native_client__) && \
+ defined(_NEWLIB_VERSION)
+/* newlib under NaCl is missing PTHREAD_RWLOCK_INITIALIZER. See
+ * https://code.google.com/p/nativeclient/issues/detail?id=4160. Remove this
+ * when that bug is fixed. */
+#define CRYPTO_STATIC_MUTEX_INIT \
+ { { PTHREAD_MUTEX_INITIALIZER, 0, 0, NACL_PTHREAD_ILLEGAL_THREAD_ID, \
+ PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER } }
+#else
#define CRYPTO_STATIC_MUTEX_INIT { PTHREAD_RWLOCK_INITIALIZER }
+#endif
+
#else
struct CRYPTO_STATIC_MUTEX {
CRYPTO_once_t once;