Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d3ccde8a
Commit
d3ccde8a
authored
Sep 04, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #7736: Release the GIL around calls to opendir() and closedir()
in the posix module. Patch by Marcin Bachry.
parent
327fd40d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
Misc/NEWS
Misc/NEWS
+3
-0
Modules/posixmodule.c
Modules/posixmodule.c
+10
-1
No files found.
Misc/NEWS
View file @
d3ccde8a
...
...
@@ -93,6 +93,9 @@ Core and Builtins
Extensions
----------
- Issue #7736: Release the GIL around calls to opendir() and closedir()
in the posix module. Patch by Marcin Bachry.
- Issue #4835: make PyLong_FromSocket_t() and PyLong_AsSocket_t() private
to the socket module, and fix the width of socket descriptors to be
correctly detected under 64-bit Windows.
...
...
Modules/posixmodule.c
View file @
d3ccde8a
...
...
@@ -2580,11 +2580,16 @@ posix_listdir(PyObject *self, PyObject *args)
oname
=
PyBytes_FromString
(
"."
);
}
name
=
PyBytes_AsString
(
oname
);
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
(
oname
);
}
if
((
d
=
PyList_New
(
0
))
==
NULL
)
{
Py_BEGIN_ALLOW_THREADS
closedir
(
dirp
);
Py_END_ALLOW_THREADS
Py_DECREF
(
oname
);
return
NULL
;
}
...
...
@@ -2597,7 +2602,9 @@ posix_listdir(PyObject *self, PyObject *args)
if
(
errno
==
0
)
{
break
;
}
else
{
Py_BEGIN_ALLOW_THREADS
closedir
(
dirp
);
Py_END_ALLOW_THREADS
Py_DECREF
(
d
);
return
posix_error_with_allocated_filename
(
oname
);
}
...
...
@@ -2621,7 +2628,9 @@ posix_listdir(PyObject *self, PyObject *args)
}
Py_DECREF
(
v
);
}
Py_BEGIN_ALLOW_THREADS
closedir
(
dirp
);
Py_END_ALLOW_THREADS
Py_DECREF
(
oname
);
return
d
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment