Allow NULL in pthread_mutex_lock/unlock.
The pthread_mutex_lock and pthread_mutex_unlock were allowed to
fail silently on L 32 bit devices when passed a NULL. We changed
this to a crash on 32 bit devices, but there are still games that make
these calls and are not likely to be updated. Therefore, once again
allow NULL to be passed in on 32 bit devices.
Bug: 19995172
(cherry picked from commit 511cfd9dc8cb41bca4920687c7d816ee916ee8e5)
Change-Id: I159a99a941cff94297ef3fffda7075f8ef1ae252
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index 26d68e4..260ae5b 100644
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
@@ -176,10 +176,18 @@
int pthread_mutex_destroy(pthread_mutex_t*) __nonnull((1));
int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*) __nonnull((1));
+#if !defined(__LP64__)
+int pthread_mutex_lock(pthread_mutex_t*) /* __nonnull((1)) */;
+#else
int pthread_mutex_lock(pthread_mutex_t*) __nonnull((1));
+#endif
int pthread_mutex_timedlock(pthread_mutex_t*, const struct timespec*) __nonnull((1, 2));
int pthread_mutex_trylock(pthread_mutex_t*) __nonnull((1));
+#if !defined(__LP4__)
+int pthread_mutex_unlock(pthread_mutex_t*) /* __nonnull((1)) */;
+#else
int pthread_mutex_unlock(pthread_mutex_t*) __nonnull((1));
+#endif
int pthread_once(pthread_once_t*, void (*)(void)) __nonnull((1, 2));