Author: antoine.pitrou Date: Sat Sep 4 19:27:10 2010 New Revision: 84491 Log: Merged revisions 84489 via svnmerge from 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. ........ Modified: python/branches/release27-maint/ (props changed) python/branches/release27-maint/Misc/NEWS python/branches/release27-maint/Modules/posixmodule.c Modified: python/branches/release27-maint/Misc/NEWS ============================================================================== --- python/branches/release27-maint/Misc/NEWS (original) +++ python/branches/release27-maint/Misc/NEWS Sat Sep 4 19:27:10 2010 @@ -225,6 +225,9 @@ 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. Modified: python/branches/release27-maint/Modules/posixmodule.c ============================================================================== --- python/branches/release27-maint/Modules/posixmodule.c (original) +++ python/branches/release27-maint/Modules/posixmodule.c Sat Sep 4 19:27:10 2010 @@ -2333,11 +2333,16 @@ } 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; } @@ -2350,7 +2355,9 @@ 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); } @@ -2391,7 +2398,9 @@ } Py_DECREF(v); } + Py_BEGIN_ALLOW_THREADS closedir(dirp); + Py_END_ALLOW_THREADS PyMem_Free(name); return d;
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4