Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.11] fixes gh-96078: os.sched_yield release the GIL while calling sched_yield(2). (gh-97965) #98014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixes gh-96078: os.sched_yield release the GIL while calling sched_yi…
…eld(2). (gh-97965)

(cherry picked from commit b9d2e81)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
  • Loading branch information
corona10 authored and miss-islington committed Oct 7, 2022
commit 920e025c8b515527d16eba3ffd0568bacfe7212e
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:func:`os.sched_yield` now release the GIL while calling sched_yield(2).
Patch by Dong-hee Na.
7 changes: 6 additions & 1 deletion 7 Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -7096,8 +7096,13 @@ static PyObject *
os_sched_yield_impl(PyObject *module)
/*[clinic end generated code: output=902323500f222cac input=e54d6f98189391d4]*/
{
if (sched_yield())
int result;
Py_BEGIN_ALLOW_THREADS
result = sched_yield();
Py_END_ALLOW_THREADS
if (result < 0) {
return posix_error();
}
Py_RETURN_NONE;
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.