summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2cf1557)
raw | patch | inline | side by side (parent: 2cf1557)
author | Elliott Hughes <enh@google.com> | |
Tue, 7 Oct 2014 23:02:11 +0000 (16:02 -0700) | ||
committer | Elliott Hughes <enh@google.com> | |
Tue, 7 Oct 2014 23:17:14 +0000 (23:17 +0000) |
This library calls pthread_mutex_lock and pthread_mutex_unlock with a NULL
pthread_mutex_t*. This gives them (and their users) one release to fix things.
Bug: 17443936
(cherry picked from commit 7d3f553f989f830976efa92ddc3c84661d4d42aa)
Change-Id: Ie26bbecd3a74d61113b51c18832872499b97ee86
(cherry picked from commit b5e7eba6d1b97e471996fcfe7dbde7cbba7512ef)
pthread_mutex_t*. This gives them (and their users) one release to fix things.
Bug: 17443936
(cherry picked from commit 7d3f553f989f830976efa92ddc3c84661d4d42aa)
Change-Id: Ie26bbecd3a74d61113b51c18832872499b97ee86
(cherry picked from commit b5e7eba6d1b97e471996fcfe7dbde7cbba7512ef)
libc/bionic/pthread_mutex.cpp | patch | blob | history | |
libc/include/pthread.h | patch | blob | history |
index 546166166d80599282cd09bb7ae195a702f8c5f2..ae2557f080588dc84057fb8f2764e4f17169d3e3 100644 (file)
@@ -440,6 +440,12 @@ static inline __always_inline int _recursive_increment(pthread_mutex_t* mutex, i
}
int pthread_mutex_lock(pthread_mutex_t* mutex) {
+#if !defined(__LP64__)
+ if (mutex == NULL) {
+ return EINVAL;
+ }
+#endif
+
int mvalue, mtype, tid, shared;
mvalue = mutex->value;
}
int pthread_mutex_unlock(pthread_mutex_t* mutex) {
+#if !defined(__LP64__)
+ if (mutex == NULL) {
+ return EINVAL;
+ }
+#endif
+
int mvalue, mtype, tid, shared;
mvalue = mutex->value;
diff --git a/libc/include/pthread.h b/libc/include/pthread.h
index 86a10051e60307770376cb9b47f62a66c87bd22e..c32890b03d5e3ffd099f48f914587480ad102672 100644 (file)
--- a/libc/include/pthread.h
+++ b/libc/include/pthread.h
int pthread_mutex_destroy(pthread_mutex_t*) __nonnull((1));
int pthread_mutex_init(pthread_mutex_t*, const pthread_mutexattr_t*) __nonnull((1));
-int pthread_mutex_lock(pthread_mutex_t*) __nonnull((1));
+int pthread_mutex_lock(pthread_mutex_t*) /* __nonnull((1)) */;
int pthread_mutex_timedlock(pthread_mutex_t*, const struct timespec*) __nonnull((1, 2));
int pthread_mutex_trylock(pthread_mutex_t*) __nonnull((1));
-int pthread_mutex_unlock(pthread_mutex_t*) __nonnull((1));
+int pthread_mutex_unlock(pthread_mutex_t*) /* __nonnull((1)) */;
int pthread_once(pthread_once_t*, void (*)(void)) __nonnull((1, 2));