8000 gh-76785: Clean Up the Channels Module by ericsnowcurrently · Pull Request #110568 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div class="gh-header-show ">

gh-76785: Clean Up the Channels Module #110568

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
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
Next Next commit
_channelends_close_end() -> _channelends_release_end()
  • Loading branch information
ericsnowcurrently committed Oct 17, 2023
commit 84c43878b9a48e5a9a2c8cda6f375181911524d0
14 changes: 7 additions & 7 deletions Modules/_xxinterpchannelsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ _channelends_is_open(_channelends *ends)
}

static void
_channelends_close_end(_channelends *ends, _channelend *end, int send)
_channelends_release_end(_channelends *ends, _channelend *end, int send)
{
end->open = 0;
if (send) {
Expand All @@ -1125,7 +1125,7 @@ _channelends_release_interpreter(_channelends *ends, int64_t interpid, int which
return -1;
}
}
_channelends_close_end(ends, end, 1);
_channelends_release_end(ends, end, 1);
}
if (which <= 0) { // recv/both
end = _channelend_find(ends->recv, interpid, &prev);
Expand All @@ -1136,7 +1136,7 @@ _channelends_release_interpreter(_channelends *ends, int64_t interpid, int which
return -1;
}
}
_channelends_close_end(ends, end, 0);
_channelends_release_end(ends, end, 0);
}
return 0;
}
Expand All @@ -1150,12 +1150,12 @@ _channelends_release_all(_channelends *ends, int which, int force)
// Ensure all the "send"-associated interpreters are closed.
_channelend *end;
for (end = ends->send; end != NULL; end = end->next) {
_channelends_close_end(ends, end, 1);
_channelends_release_end(ends, end, 1);
}

// Ensure all the "recv"-associated interpreters are closed.
for (end = ends->recv; end != NULL; end = end->next) {
_channelends_close_end(ends, end, 0);
_channelends_release_end(ends, end, 0);
}
}

Expand All @@ -1166,11 +1166,11 @@ _channelends_clear_interpreter(_channelends *ends, int64_t interpid)
_channelend *end;
end = _channelend_find(ends->send, interpid, NULL);
if (end != NULL) {
_channelends_close_end(ends, end, 1);
_channelends_release_end(ends, end, 1);
}
end = _channelend_find(ends->recv, interpid, NULL);
if (end != NULL) {
_channelends_close_end(ends, end, 0);
_channelends_release_end(ends, end, 0);
}
}

Expand Down
0