Hackers,

In the hope of this not being derailed by larger/more unpopular pieces of
work, I'm attaching a tiny patch which I don't believe will have any
negative impact - but will remove one blocker for $subject (sigprocmask
usage is "unspecified" in multithreaded code [1]).

The patch replaces *sigprocmask *with *pthread_sigmask*. They have
identical APIs ("[pthread_sigmask] shall be equivalent to sigprocmask(),
without the restriction that the call be made in a single-threaded
process"[1])

The rationale here is that as far as I can tell this is the **only**
blocker to using multithreaded code in a BGWorker which can't be avoided by
adhering to strict code rules (eg: no PG calls from non-main threads, no
interaction with signals from non-main threads).

Before this went in the rules would need to be agreed upon and documented -
but hopefully it's at least a way forward / a way to progress this
discussion.

Cheers,
James

[1]
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html

-- 
The contents of this email are confidential and may be subject to legal or 
professional privilege and copyright. No representation is made that this 
email is free of viruses or other defects. If you have received this 
communication in error, you may not copy or distribute any part of it or 
otherwise disclose its contents to anyone. Please advise the sender of your 
incorrect receipt of this correspondence.

Attachment: pthread_sigmask.patch
Description: Binary data

Reply via email to