Make pthread_create more forgiving of invalid sched_policy.
Bug: 7005326 Change-Id: I4e33d8e7d70fbfcf8a1bcc0e4c33279b42092a0a
This commit is contained in:
parent
2aceb4bcb3
commit
e58303249b
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user