8000 gh-112069: Make setiter_iternext to be thread-safe by corona10 · Pull Request #117935 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-112069: Make setiter_iternext to be thread-safe #117935

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 2 commits into from
Apr 16, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Address code review
  • Loading branch information
corona10 committed Apr 16, 2024
commit 67a9efcbe015d4d3cb29d68703b978f7ae8fd130
10 changes: 3 additions & 7 deletions Objects/setobject.c
866C
Original file line number Diff line number Diff line change
Expand Up @@ -866,16 +866,12 @@ static PyObject *setiter_iternext(setiterobject *si)
Py_END_CRITICAL_SECTION();
si->si_pos = i+1;
if (key == NULL) {
goto fail;
si->si_set = NULL;
Py_DECREF(so);
return NULL;
}
si->len--;
return key;

fail:
si->si_set = NULL;
Py_DECREF(so);
Py_XDECREF(key);
return NULL;
}

PyTypeObject PySetIter_Type = {
Expand Down
0