Commit bd25d598 authored by Antoine Pitrou's avatar Antoine Pitrou

Merged revisions 83921 via svnmerge from

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.
........
parent 87d52603
...@@ -398,6 +398,7 @@ Jacob Kaplan-Moss ...@@ -398,6 +398,7 @@ Jacob Kaplan-Moss
Lou Kates Lou Kates
Hiroaki Kawai Hiroaki Kawai
Sebastien Keim Sebastien Keim
Ryan Kelly
Robert Kern Robert Kern
Randall Kern Randall Kern
Magnus Kessler Magnus Kessler
......
...@@ -98,6 +98,9 @@ C-API ...@@ -98,6 +98,9 @@ C-API
Library 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. - Issue #3757: thread-local objects now support cyclic garbage collection.
Thread-local objects involved in reference cycles will be deallocated Thread-local objects involved in reference cycles will be deallocated
timely by the cyclic GC, even if the underlying thread is still running. timely by the cyclic GC, even if the underlying thread is still running.
......
...@@ -2270,7 +2270,9 @@ posix_listdir(PyObject *self, PyObject *args) ...@@ -2270,7 +2270,9 @@ posix_listdir(PyObject *self, PyObject *args)
free(wnamebuf); free(wnamebuf);
return NULL; return NULL;
} }
Py_BEGIN_ALLOW_THREADS
hFindFile = FindFirstFileW(wnamebuf, &wFileData); hFindFile = FindFirstFileW(wnamebuf, &wFileData);
Py_END_ALLOW_THREADS
if (hFindFile == INVALID_HANDLE_VALUE) { if (hFindFile == INVALID_HANDLE_VALUE) {
int error = GetLastError(); int error = GetLastError();
if (error == ERROR_FILE_NOT_FOUND) { if (error == ERROR_FILE_NOT_FOUND) {
...@@ -2348,7 +2350,9 @@ posix_listdir(PyObject *self, PyObject *args) ...@@ -2348,7 +2350,9 @@ posix_listdir(PyObject *self, PyObject *args)
if ((d = PyList_New(0)) == NULL) if ((d = PyList_New(0)) == NULL)
return NULL; return NULL;
Py_BEGIN_ALLOW_THREADS
hFindFile = FindFirstFile(namebuf, &FileData); hFindFile = FindFirstFile(namebuf, &FileData);
Py_END_ALLOW_THREADS
if (hFindFile == INVALID_HANDLE_VALUE) { if (hFindFile == INVALID_HANDLE_VALUE) {
int error = GetLastError(); int error = GetLastError();
if (error == ERROR_FILE_NOT_FOUND) if (error == ERROR_FILE_NOT_FOUND)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment