Richard Purdie added the comment:
I think the python code implementing pthread_sigmask already does trigger
interrupts if any have been queued before the function returns from blocking or
unblocking.
The key subtlety which I initially missed is that if you have another thread in
your python
Gregory P. Smith added the comment:
The "trick" wouldn't be too useful though as this API can't block and the
signal flag needs to be processed on the main thread. So I guess documentation
it is.
The way I think of this is that the signal.pthread_sigmask API is pretty low
level. After that
Gregory P. Smith added the comment:
The irony... Documenting the caveat at least seems useful. Your workaround
sounds reasonable.
I don't love the idea of implementing our own mask blocked/unblocked state
check, though it probably wouldn't be very complicated. Might be interesting.
Another
New submission from Richard Purdie :
I've been struggling to get signal.pthread_sigmask to do what I expected it to
do from the documentation. Having looked at the core python code handling
signals I now (think?!) I understand what is happening. It might be possible
for python to improve the