]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 83921 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 9 Aug 2010 23:47:57 +0000 (23:47 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 9 Aug 2010 23:47:57 +0000 (23:47 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83921 | antoine.pitrou | 2010-08-10 01:39:31 +0200 (mar., 10 août 2010) | 4 lines

  Issue #6915: Under Windows, os.listdir() didn't release the Global
  Interpreter Lock around all system calls.  Original patch by Ryan Kelly.
........

Misc/ACKS
Misc/NEWS
Modules/posixmodule.c

index 67684eb539ed08e6a8e8e41b51bd75bf4c07c326..1b3f0d50a9c951fce81f8ac0a38586896d9aa3fa 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -398,6 +398,7 @@ Jacob Kaplan-Moss
 Lou Kates
 Hiroaki Kawai
 Sebastien Keim
+Ryan Kelly
 Robert Kern
 Randall Kern
 Magnus Kessler
index 9e2603d5cecd6d5772c2140f7d0fd470e61ce128..a79e4cd8b654f08e037f62df950b40bd9e967918 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -98,6 +98,9 @@ C-API
 Library
 -------
 
+- Issue #6915: Under Windows, os.listdir() didn't release the Global
+  Interpreter Lock around all system calls.  Original patch by Ryan Kelly.
+
 - Issue #3757: thread-local objects now support cyclic garbage collection.
   Thread-local objects involved in reference cycles will be deallocated
   timely by the cyclic GC, even if the underlying thread is still running.
index cb3075bdbc975439e95e4a7ed511352e4bee9580..d6e491cc969d97bf596f3b74469b6ee0139dce54 100644 (file)
@@ -2270,7 +2270,9 @@ posix_listdir(PyObject *self, PyObject *args)
                 free(wnamebuf);
                 return NULL;
             }
+            Py_BEGIN_ALLOW_THREADS
             hFindFile = FindFirstFileW(wnamebuf, &wFileData);
+            Py_END_ALLOW_THREADS
             if (hFindFile == INVALID_HANDLE_VALUE) {
                 int error = GetLastError();
                 if (error == ERROR_FILE_NOT_FOUND) {
@@ -2348,7 +2350,9 @@ posix_listdir(PyObject *self, PyObject *args)
     if ((d = PyList_New(0)) == NULL)
         return NULL;
 
+    Py_BEGIN_ALLOW_THREADS
     hFindFile = FindFirstFile(namebuf, &FileData);
+    Py_END_ALLOW_THREADS
     if (hFindFile == INVALID_HANDLE_VALUE) {
         int error = GetLastError();
         if (error == ERROR_FILE_NOT_FOUND)