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
877509ae
Commit
877509ae
authored
Apr 23, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #11382: Trivial system calls, such as dup() or pipe(), needn't
release the GIL. Patch by Charles-François Natali.
parent
00bdbe1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
14 deletions
+3
-14
Misc/NEWS
Misc/NEWS
+3
-0
Modules/posixmodule.c
Modules/posixmodule.c
+0
-14
No files found.
Misc/NEWS
View file @
877509ae
...
...
@@ -113,6 +113,9 @@ Core and Builtins
Library
-------
-
Issue
#
11382
:
Trivial
system
calls
,
such
as
dup
()
or
pipe
(),
needn
't
release the GIL. Patch by Charles-François Natali.
- Issue #11223: Add threading._info() function providing informations about
the thread implementation.
...
...
Modules/posixmodule.c
View file @
877509ae
...
...
@@ -3083,9 +3083,7 @@ posix_getpriority(PyObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"ii"
,
&
which
,
&
who
))
return
NULL
;
errno
=
0
;
Py_BEGIN_ALLOW_THREADS
retval
=
getpriority
(
which
,
who
);
Py_END_ALLOW_THREADS
if
(
errno
!=
0
)
return
posix_error
();
return
PyLong_FromLong
((
long
)
retval
);
...
...
@@ -3105,9 +3103,7 @@ posix_setpriority(PyObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"iii"
,
&
which
,
&
who
,
&
prio
))
return
NULL
;
Py_BEGIN_ALLOW_THREADS
retval
=
setpriority
(
which
,
who
,
prio
);
Py_END_ALLOW_THREADS
if
(
retval
==
-
1
)
return
posix_error
();
Py_RETURN_NONE
;
...
...
@@ -6010,9 +6006,7 @@ posix_dup(PyObject *self, PyObject *args)
return
NULL
;
if
(
!
_PyVerify_fd
(
fd
))
return
posix_error
();
Py_BEGIN_ALLOW_THREADS
fd
=
dup
(
fd
);
Py_END_ALLOW_THREADS
if
(
fd
<
0
)
return
posix_error
();
return
PyLong_FromLong
((
long
)
fd
);
...
...
@@ -6031,9 +6025,7 @@ posix_dup2(PyObject *self, PyObject *args)
return
NULL
;
if
(
!
_PyVerify_fd_dup2
(
fd
,
fd2
))
return
posix_error
();
Py_BEGIN_ALLOW_THREADS
res
=
dup2
(
fd
,
fd2
);
Py_END_ALLOW_THREADS
if
(
res
<
0
)
return
posix_error
();
Py_INCREF
(
Py_None
);
...
...
@@ -6525,9 +6517,7 @@ posix_pipe(PyObject *self, PyObject *noargs)
HFILE
read
,
write
;
APIRET
rc
;
Py_BEGIN_ALLOW_THREADS
rc
=
DosCreatePipe
(
&
read
,
&
write
,
4096
);
Py_END_ALLOW_THREADS
if
(
rc
!=
NO_ERROR
)
return
os2_error
(
rc
);
...
...
@@ -6536,9 +6526,7 @@ posix_pipe(PyObject *self, PyObject *noargs)
#if !defined(MS_WINDOWS)
int
fds
[
2
];
int
res
;
Py_BEGIN_ALLOW_THREADS
res
=
pipe
(
fds
);
Py_END_ALLOW_THREADS
if
(
res
!=
0
)
return
posix_error
();
return
Py_BuildValue
(
"(ii)"
,
fds
[
0
],
fds
[
1
]);
...
...
@@ -6546,9 +6534,7 @@ posix_pipe(PyObject *self, PyObject *noargs)
HANDLE
read
,
write
;
int
read_fd
,
write_fd
;
BOOL
ok
;
Py_BEGIN_ALLOW_THREADS
ok
=
CreatePipe
(
&
read
,
&
write
,
NULL
,
0
);
Py_END_ALLOW_THREADS
if
(
!
ok
)
return
win32_error
(
"CreatePipe"
,
NULL
);
read_fd
=
_open_osfhandle
((
Py_intptr_t
)
read
,
0
);
...
...
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