提交 aecda353 编写于 作者: R Rich Felker

avoid using signals when a thread attempts to cancel itself

not only is pthread_kill expensive in this case; it also breaks
testing under qemu app-level emulation.
上级 47314f1e
......@@ -92,5 +92,6 @@ int pthread_cancel(pthread_t t)
init = 1;
}
a_store(&t->cancel, 1);
if (t == pthread_self() && !t->cancelasync) return 0;
return pthread_kill(t, SIGCANCEL);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册