[Python-checkins] cpython: Issue #23836: Document functions releasing the GIL in fileutils.c

victor.stinner python-checkins at python.org
Wed Apr 1 18:51:52 CEST 2015


https://hg.python.org/cpython/rev/d9b9e2a68e7c
changeset:   95356:d9b9e2a68e7c
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Apr 01 18:34:32 2015 +0200
summary:
  Issue #23836: Document functions releasing the GIL in fileutils.c

files:
  Python/fileutils.c |  8 +++++---
  1 files changed, 5 insertions(+), 3 deletions(-)


diff --git a/Python/fileutils.c b/Python/fileutils.c
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -667,7 +667,8 @@
    error on error. On POSIX, set errno on error. Fill status and return 0 on
    success.
 
-   The GIL must be held. */
+   Release the GIL to call GetFileType() and GetFileInformationByHandle(), or
+   to call fstat(). The caller must hold the GIL. */
 int
 _Py_fstat(int fd, struct _Py_stat_struct *status)
 {
@@ -968,7 +969,7 @@
    When interrupted by a signal (open() fails with EINTR), retry the syscall,
    except if the Python signal handler raises an exception.
 
-   The GIL must be held. */
+   Release the GIL to call open(). The caller must hold the GIL. */
 int
 _Py_open(const char *pathname, int flags)
 {
@@ -1054,7 +1055,8 @@
    When interrupted by a signal (open() fails with EINTR), retry the syscall,
    except if the Python signal handler raises an exception.
 
-   The GIL must be held. */
+   Release the GIL to call _wfopen() or fopen(). The caller must hold
+   the GIL. */
 FILE*
 _Py_fopen_obj(PyObject *path, const char *mode)
 {

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list