Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9ce67d

Browse files
committed
Initialize thread_id to 0 in unthreaded build. Fixes #770247.
1 parent 61bfb73 commit f9ce67d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Python/pystate.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ PyThreadState_New(PyInterpreterState *interp)
144144
tstate->tick_counter = 0;
145145
tstate->gilstate_counter = 0;
146146
tstate->async_exc = NULL;
147+
#ifdef WITH_THREAD
147148
tstate->thread_id = PyThread_get_thread_ident();
149+
#else
150+
tstate->thread_id = 0;
151+
#endif
148152

149153
tstate->dict = NULL;
150154

0 commit comments

Comments
 (0)