RIP pthread_cancel() in curl. It was an interesting adventure.
#curl
eissing.org/icing/posts/rip_pt…
RIP pthread_cancel
I posted about adding pthread_cancel use in curl about three weeks ago, we released this in curl 8.16.0 and it blew up right in our faces. Now, with #18540 we are ripping it out again.icing's blog
Richard Barrell
in reply to Stefan Eissing • • •I think it's reasonable to declare that pthread_cancel() is effectively broken for any nontrivial use on contemporary OSes and it is unlikely to be fixed any time soon.
(I suspect it would actually be easier to cajole libc maintainers into adding an async friendly version of GAI() than to make GAI() cancellation safe.)
If you want a cancellable thing from which you can make blocking calls, the only near-universal option is subprocesses. Unfortunately there are reasons why in some ecosystems it is impolite for a library to start a subprocess.