10000 gh-103092: Isolate _tkinter (WIP) by erlend-aasland · Pull Request #103108 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-103092: Isolate _tkinter (WIP) #103108

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

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
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
Put HeadFHCD into module state
  • Loading branch information
erlend-aasland committed Mar 29, 2023
commit b6ac21ddd555c8c3230e20d8b45af0197ebbac2a
10 changes: 5 additions & 5 deletions Modules/_tkinter.c
Original file line number Diff line number Diff line change
Expand Up @@ -2432,19 +2432,18 @@ typedef struct _fhcdata {
struct _fhcdata *next;
} FileHandler_ClientData;

static FileHandler_ClientData *HeadFHCD;

static FileHandler_ClientData *
NewFHCD(PyObject *func, PyObject *file, int id)
{
FileHandler_ClientData *p;
p = PyMem_NEW(FileHandler_ClientData, 1);
if (p != NULL) {
module_state *st = GLOBAL_STATE();
p->func = Py_XNewRef(func);
p->file = Py_XNewRef(file);
p->id = id;
p->next = HeadFHCD;
HeadFHCD = p;
p->next = st->HeadFHCD;
st->HeadFHCD = p;
}
return p;
}
Expand All @@ -2454,7 +2453,8 @@ DeleteFHCD(int id)
{
FileHandler_ClientData *p, **pp;

pp = &HeadFHCD;
module_state *st = GLOBAL_STATE();
pp = &st->HeadFHCD;
while ((p = *pp) != NULL) {
if (p->id == id) {
*pp = p->next;
Expand Down
1 change: 1 addition & 0 deletions Modules/tkinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef struct {

// Util
int Tkinter_busywaitinterval;
struct _fhcdata *HeadFHCD;
} module_state;

extern module_state global_state;
Expand Down
1 change: 0 additions & 1 deletion Tools/c-analyzer/cpython/globals-to-fix.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ Modules/_ssl/debughelpers.c _PySSL_keylog_callback lock -
Modules/_tkinter.c - call_mutex -
Modules/_tkinter.c - var_mutex -
Modules/_tkinter.c - command_mutex -
Modules/_tkinter.c - HeadFHCD -
Modules/_tkinter.c - stdin_ready -
Modules/_tkinter.c - event_tstate -
Modules/_xxinterpchannelsmodule.c - _globals -
Expand Down
0