提交 0b4c92b7 编写于 作者: R Rich Felker

optimize raise not to make a syscall for getting tid

assuming signals are blocked, which they are here, the tid in the
thread structure is always valid and cannot change out from under us.
上级 cff4b910
......@@ -5,11 +5,9 @@
int raise(int sig)
{
int tid, ret;
sigset_t set;
__block_app_sigs(&set);
tid = __syscall(SYS_gettid);
ret = syscall(SYS_tkill, tid, sig);
int ret = syscall(SYS_tkill, __pthread_self()->tid, sig);
__restore_sigs(&set);
return ret;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册