|
|
Message-ID: <20261105185412.GX23438@brightrain.aerifal.cx> Date: Thu, 5 Nov 2026 13:54:13 -0500 From: Rich Felker <dalias@...c.org> To: Luca Kellermann <mailto.luca.kellermann@...il.com> Cc: musl@...ts.openwall.com Subject: Re: [PATCH] thrd_create: inherit signal mask from creating thread 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. 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. Rich
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.