From: Antoine Pitrou Date: Tue, 13 Jun 2017 08:21:28 +0000 (+0200) Subject: [2.7] Mention how to disable signal fd wakeup (GH-2140) (#2151) X-Git-Tag: v2.7.14rc1~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15a6127e72c6bf8ac75bd6266ebe24df75640c14;p=thirdparty%2FPython%2Fcpython.git [2.7] Mention how to disable signal fd wakeup (GH-2140) (#2151) (cherry picked from commit d79c1d4a9406384f10a37f26a7515ce79f9fdd78) --- diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst index fe7983b2d37d..3b02a3926345 100644 --- a/Doc/library/signal.rst +++ b/Doc/library/signal.rst @@ -197,8 +197,10 @@ The :mod:`signal` module defines the following functions: written to the fd. This can be used by a library to wakeup a poll or select call, allowing the signal to be fully processed. - The old wakeup fd is returned. *fd* must be non-blocking. It is up to the - library to remove any bytes before calling poll or select again. + The old wakeup fd is returned (or -1 if file descriptor wakeup was not + enabled). If *fd* is -1, file descriptor wakeup is disabled. + If not -1, *fd* must be non-blocking. It is up to the library to remove + any bytes from *fd* before calling poll or select again. When threads are enabled, this function can only be called from the main thread; attempting to call it from other threads will cause a :exc:`ValueError`