svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84489 | antoine.pitrou | 2010-09-04 19:21:57 +0200 (sam., 04 sept. 2010) | 4 lines
Issue #7736: Release the GIL around calls to opendir() and closedir()
in the posix module. Patch by Marcin Bachry.
........
Extension Modules
-----------------
+- Issue #7736: Release the GIL around calls to opendir() and closedir()
+ in the posix module. Patch by Marcin Bachry.
+
- As a result of issue #2521, the _weakref module is now compiled into the
interpreter by default.
}
if (!PyArg_ParseTuple(args, "et:listdir", Py_FileSystemDefaultEncoding, &name))
return NULL;
- if ((dirp = opendir(name)) == NULL) {
+ Py_BEGIN_ALLOW_THREADS
+ dirp = opendir(name);
+ Py_END_ALLOW_THREADS
+ if (dirp == NULL) {
return posix_error_with_allocated_filename(name);
}
if ((d = PyList_New(0)) == NULL) {
+ Py_BEGIN_ALLOW_THREADS
closedir(dirp);
+ Py_END_ALLOW_THREADS
PyMem_Free(name);
return NULL;
}
if (errno == 0) {
break;
} else {
+ Py_BEGIN_ALLOW_THREADS
closedir(dirp);
+ Py_END_ALLOW_THREADS
Py_DECREF(d);
return posix_error_with_allocated_filename(name);
}
}
Py_DECREF(v);
}
+ Py_BEGIN_ALLOW_THREADS
closedir(dirp);
+ Py_END_ALLOW_THREADS
PyMem_Free(name);
return d;