* enh: > On Tue, Nov 12, 2019 at 9:51 PM Florian Weimer <fw@xxxxxxxxxxxxx> wrote: >> >> * enh: >> >> > no, because the C library has two choices when a thread exits: >> > >> > 1. unmap the thread. >> > >> > 2. keep the thread around for recycling. >> > >> > if you choose 1 (optimizing for space, like Android), your dereference >> > is illegal. >> >> This choice is only available for threads in a detached state. For >> joinable threads, a conforming implementation cannot immediately >> deallocate all data structures on thread termination. Among other >> things, it has to store the future return value of pthread_join >> somewhere. > > ah, you're trying to say "signal 0 is potentially usable for a > joinable thread that's waiting to be joined"? that's true, but i'm not > sure how that's relevant to this patch. that wouldn't be an "invalid > thread ID" until it's joined. Correct. That's POSIX's argument why ESRCH wouldn't be valid to return here. It's still a forceful loss of information, and particularly annoying since POSIX doesn't specify pthread_tryjoin. But I'm glad we've brought our discussion to a conclusion. 8-)