Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit11945f2

Browse files
fixesgh-96078: os.sched_yield release the GIL while calling sched_yield(2). (gh-97965)
(cherry picked from commitb9d2e81)Co-authored-by: Dong-hee Na <donghee.na@python.org>
1 parente0e303a commit11945f2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7028,8 +7028,13 @@ static PyObject *
70287028
os_sched_yield_impl(PyObject*module)
70297029
/*[clinic end generated code: output=902323500f222cac input=e54d6f98189391d4]*/
70307030
{
7031-
if (sched_yield())
7031+
intresult;
7032+
Py_BEGIN_ALLOW_THREADS
7033+
result=sched_yield();
7034+
Py_END_ALLOW_THREADS
7035+
if (result<0) {
70327036
returnposix_error();
7037+
}
70337038
Py_RETURN_NONE;
70347039
}
70357040

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp