We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1c4d56 commit b9d2e81Copy full SHA for b9d2e81
Misc/NEWS.d/next/Core and Builtins/2022-10-06-15-45-57.gh-issue-96078.fS-6mU.rst
@@ -0,0 +1,2 @@
1
+:func:`os.sched_yield` now release the GIL while calling sched_yield(2).
2
+Patch by Dong-hee Na.
Modules/posixmodule.c
@@ -7075,8 +7075,13 @@ static PyObject *
7075
os_sched_yield_impl(PyObject *module)
7076
/*[clinic end generated code: output=902323500f222cac input=e54d6f98189391d4]*/
7077
{
7078
- if (sched_yield())
+ int result;
7079
+ Py_BEGIN_ALLOW_THREADS
7080
+ result = sched_yield();
7081
+ Py_END_ALLOW_THREADS
7082
+ if (result < 0) {
7083
return posix_error();
7084
+ }
7085
Py_RETURN_NONE;
7086
}
7087
0 commit comments