[issue8407] expose signalfd(2) and sigprocmask(2) in the signal module
STINNER Victor
report at bugs.python.org
Wed Apr 20 02:22:31 CEST 2011
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
signal_pthread_sigmask.patch:
- add signal.pthread_sigmask() function with doc and tests
- add SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK constants
- fix #11859: fix tests of test_io using threads and an alarm: use pthread_sigmask() to ensure that only the main thread receives the SIGALRM signal
The code is based on the last version of python-signalfd:
https://code.launchpad.net/~exarkun/python-signalfd/trunk
Changes between python-signalfd and my patch:
- rename "sigprocmask" function to "pthread_sigmask"
- I added an unit test and the doc
- catch PyIter_Next() error
- set signum variable (the result of PyLong_AsLong) type to long (instead of int) and check its value (0 < signum < NSIG)
- I adapted the code to my coding style :-)
I will work on a similar patch for signalfd() after the pthread_sigmask() patch is accepted.
----------
keywords: +patch
Added file: http://bugs.python.org/file21735/signal_pthread_sigmask.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8407>
_______________________________________
More information about the Python-bugs-list
mailing list