]> granicus.if.org Git - python/commitdiff
Merged revisions 83921 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 10 Aug 2010 00:04:13 +0000 (00:04 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 10 Aug 2010 00:04:13 +0000 (00:04 +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 23a5205fec9b2d467d9ffd3e76e5888d98ef597b..afc42efae44f0f643aa000c5c5c67a79d11af8d9 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -409,6 +409,7 @@ Jacob Kaplan-Moss
 Lou Kates
 Hiroaki Kawai
 Sebastien Keim
+Ryan Kelly
 Robert Kern
 Randall Kern
 Magnus Kessler
index 768f5a4191fd68beefcd1cd07de24184e8c1c6ed..6bf21ac20210dc480b7bcae1e00a8bdd9a50b948 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -29,6 +29,9 @@ Core and Builtins
 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 d0d68c9e3a3444dbb365e54c42ffc5148eba97ab..5237f1466184c606c226aba3a63564a9693a58a4 100644 (file)
@@ -2127,7 +2127,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) {
@@ -2197,7 +2199,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)