diff options
author | Elliott Hughes <enh@google.com> | 2012-09-18 17:13:15 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-18 17:13:15 -0700 |
commit | 30289f0dd6ab644290bfb37b22b03b7d006628f4 (patch) | |
tree | 0724f24ae5ec39c8623a5675f3ee46b61b6676c7 | |
parent | e2a17ef444e1d3b3e27e649440a320139038d1d9 (diff) | |
parent | 47dc4d431017e701239dd7d9a16333e0ad56a0ac (diff) | |
download | bionic-30289f0dd6ab644290bfb37b22b03b7d006628f4.tar.gz |
am 47dc4d43: Merge "Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326"
* commit '47dc4d431017e701239dd7d9a16333e0ad56a0ac':
Make pthread_create more forgiving of invalid sched_policy. Bug: 7005326
-rw-r--r-- | libc/bionic/pthread.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c index 14d2fec53..da3a55152 100644 --- a/libc/bionic/pthread.c +++ b/libc/bionic/pthread.c @@ -205,6 +205,8 @@ void __thread_entry(int (*func)(void*), void *arg, void **tls) pthread_exit((void*) result); } +#include <private/logd.h> + __LIBC_ABI_PRIVATE__ int _init_thread(pthread_internal_t* thread, pid_t kernel_id, pthread_attr_t* attr, void* stack_base, bool add_to_thread_list) @@ -229,7 +231,9 @@ int _init_thread(pthread_internal_t* thread, pid_t kernel_id, pthread_attr_t* at struct sched_param param; param.sched_priority = thread->attr.sched_priority; if (sched_setscheduler(kernel_id, thread->attr.sched_policy, ¶m) == -1) { - error = errno; + // For back compat reasons, we just warn about possible invalid sched_policy + const char* msg = "pthread_create sched_setscheduler call failed: %s\n"; + __libc_android_log_print(ANDROID_LOG_WARN, "libc", msg, strerror(errno)); } } |