mirror of
git://git.musl-libc.org/musl
synced 2024-12-27 01:02:12 +00:00
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.
This commit is contained in:
parent
47314f1e67
commit
aecda35373
@ -92,5 +92,6 @@ int pthread_cancel(pthread_t t)
|
|||||||
init = 1;
|
init = 1;
|
||||||
}
|
}
|
||||||
a_store(&t->cancel, 1);
|
a_store(&t->cancel, 1);
|
||||||
|
if (t == pthread_self() && !t->cancelasync) return 0;
|
||||||
return pthread_kill(t, SIGCANCEL);
|
return pthread_kill(t, SIGCANCEL);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user