Index: Modules/_tkinter.c =================================================================== --- Modules/_tkinter.c (révision 70631) +++ Modules/_tkinter.c (copie de travail) @@ -1137,7 +1137,9 @@ /* This mutex synchronizes inter-thread command calls. */ +#ifdef WITH_THREAD TCL_DECLARE_MUTEX(call_mutex) +#endif typedef struct Tkapp_CallEvent { Tcl_Event ev; /* Must be first */ @@ -1258,6 +1260,8 @@ return res; } +#ifdef WITH_THREAD + /* Tkapp_CallProc is the event procedure that is executed in the context of the Tcl interpreter thread. Initially, it holds the Tcl lock, and doesn't hold the Python lock. */ @@ -1302,6 +1306,8 @@ return 1; } +#endif + /* This is the main entry point for calling a Tcl command. It supports three cases, with regard to threading: 1. Tcl is not threaded: Must have the Tcl lock, then can invoke command in @@ -1531,7 +1537,9 @@ /** Tcl Variable **/ +#ifdef WITH_THREAD TCL_DECLARE_MUTEX(var_mutex) +#endif typedef PyObject* (*EventFunc)(PyObject*, PyObject *args, int flags); typedef struct VarEvent { @@ -1562,6 +1570,8 @@ return 0; } +#ifdef WITH_THREAD + static void var_perform(VarEvent *ev) { @@ -1589,11 +1599,13 @@ return 1; } +#endif + static PyObject* var_invoke(EventFunc func, PyObject *selfptr, PyObject *args, int flags) { - TkappObject *self = (TkappObject*)selfptr; #ifdef WITH_THREAD + TkappObject *self = (TkappObject*)selfptr; if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { TkappObject *self = (TkappObject*)selfptr; VarEvent *ev;