diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-08-28 12:45:44 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-08-28 12:45:44 -0400 |
commit | 060ed9367337cbbd59a9e5e638a1c2f460192f25 (patch) | |
tree | cdb04df5887a422cdc4a239d68664c393bd23b47 /src/thread/pthread_sigmask.c | |
parent | 92c52644e04ac754b1b282a9d33d033e04e1399e (diff) | |
download | musl-060ed9367337cbbd59a9e5e638a1c2f460192f25.tar.gz musl-060ed9367337cbbd59a9e5e638a1c2f460192f25.tar.bz2 musl-060ed9367337cbbd59a9e5e638a1c2f460192f25.tar.xz musl-060ed9367337cbbd59a9e5e638a1c2f460192f25.zip |
fix deadlock in async thread self-cancellation
with async cancellation enabled, pthread_cancel(pthread_self())
deadlocked due to pthread_kill holding killlock which is needed by
pthread_exit.
this could be solved by making pthread_kill block signals around the
critical section, at least when the target thread is itself, but the
issue only arises for cancellation, and otherwise would just be
imposing unnecessary cost.
instead just have pthread_cancel explicitly check for async
self-cancellation and call pthread_exit(PTHREAD_CANCELED) directly
rather than going through the signal machinery.
Diffstat (limited to 'src/thread/pthread_sigmask.c')
0 files changed, 0 insertions, 0 deletions