|
|
Message-ID: <au-dX8WbBh6c64sy@mail.gmail.com> Date: Sat, 7 Nov 2026 22:51:27 +0100 From: Luca Kellermann <mailto.luca.kellermann@...il.com> To: Rich Felker <dalias@...c.org> Cc: musl@...ts.openwall.com Subject: Re: [PATCH] thrd_create: inherit signal mask from creating thread On Thu, Nov 05, 2026 at 01:54:13PM -0500, Rich Felker wrote: > On Thu, Nov 05, 2026 at 03:39:51PM +0100, Luca Kellermann wrote: > > POSIX.1-2024 requires that the new thread created by thrd_create() > > inherits the signal mask from the creating thread, just like the new > > thread created by pthread_create(). > > > > it seems like this was initially the case when thrd_create() was > > implemented in commit 23614b0fcb4cd4d7b2e4148d3b1887b642169765. commit > > 04335d9260c076cf4d9264bd93dd3b06c237a639 then changed pthread_create() > > to always block signals before starting new threads but restoring the > > signal mask was only done for new threads started by pthread_create() > > (start()), not for new threads started by thrd_create() (start_c11()). > > this was before POSIX included threads.h, so it didn't violate any > > specification back then (the C standard doesn't know signal masks). > > Hm, I thought this was intentional. Threads created by library code to > be transparent to the calling application need to be created with all > signals masked. Since ISO C has no way to mask signals, the > thrd_create interface should just do that itself. At least nothing in the commit message indicates it was intentional. But I agree that blocking all signals is better. > If POSIX now requires them to inherit, we should probably change that, > but it might be worth opening a defect report. Inheriting signal mask > was really a bug in pthreads, and imposing the same on C11 threads > where the library code creating the may be POSIX-unaware seems like a > bad thing. How do you open a defect report?
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.