8000 Revert "remove gil release" · python/cpython@4c91413 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c91413

Browse files
committed
Revert "remove gil release"
This reverts commit 3685a27.
1 parent 987613a commit 4c91413

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Modules/posixmodule.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8601,7 +8601,13 @@ static PyObject *
86018601
os_setns_impl(PyObject *module, int fd, int nstype)
86028602
/*[clinic end generated code: output=5dbd055bfb66ecd0 input=c097c9aa123c43ce]*/
86038603
{
8604-
if (setns(fd, nstype) != 0) {
8604+
int res;
8605+
8606+
Py_BEGIN_ALLOW_THREADS
8607+
res = setns(fd, nstype);
8608+
Py_END_ALLOW_THREADS
8609+
8610+
if (res != 0) {
86058611
return posix_error();
86068612
}
86078613

@@ -8622,7 +8628,13 @@ static PyObject *
86228628
os_unshare_impl(PyObject *module, int flags)
86238629
/*[clinic end generated code: output=1b3177906dd237ee input=f8d7bd2c69325537]*/
86248630
{
8625-
if (unshare(flags) != 0) {
8631+
int res;
8632+
8633+
Py_BEGIN_ALLOW_THREADS
8634+
res = unshare(flags);
8635+
Py_END_ALLOW_THREADS
8636+
8637+
if (res != 0) {
86268638
return posix_error();
86278639
}
86288640

0 commit comments

Comments
 (0)
0