提交 91e1e29d 编写于 作者: R Rich Felker

fix pthread_create return value with PTHREAD_EXPLICIT_SCHED

due to moved code, commit b8742f32
inadvertently used the return value of __clone, rather than the return
value of SYS_sched_setscheduler in the new thread, to check whether it
needed to report failure. since a successful __clone returns the tid
of the new thread, which is never zero, this caused pthread_create
always to return with an invalid error number in the code path for
PTHREAD_EXPLICIT_SCHED.

this regression was not present in any releases.
上级 1ad81388
...@@ -306,6 +306,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att ...@@ -306,6 +306,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
if (do_sched) { if (do_sched) {
__futexwait(&ssa.futex, -1, 1); __futexwait(&ssa.futex, -1, 1);
ret = ssa.futex;
if (ret) return ret; if (ret) return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册