@@ -165,8 +165,8 @@ Copyright (C) 1994 Steen Lumholt.
165165
166166 Sometimes, it is necessary to have both the Python lock and the Tcl lock.
167167 (For example, when transferring data between the Tcl interpreter and/or
168- objects and Python objects.) To avoid deadlocks, when acquiring, we always
169- acquire the Tcl lock first, then the Python lock. The additional macros for
168+ objects and Python objects.) To avoid deadlocks, when acquiring, we always
169+ acquire the Tcl lock first, then the Python lock. The additional macros for
170170 finer lock control are: ENTER_OVERLAP acquires the Python lock (and restores
171171 the thread state) when already holding the Tcl lock; LEAVE_OVERLAP releases
172172 the Python lock and keeps the Tcl lock; and LEAVE_OVERLAP_TCL releases the
@@ -204,6 +204,7 @@ static PyThread_type_lock tcl_lock = 0;
204204static unsigned long tcl_lock_thread_ident = 0 ;
205205static unsigned int tcl_lock_reentry_count = 0 ;
206206
207+
207208#ifdef TCL_THREADS
208209static Tcl_ThreadDataKey state_key ;
209210typedef PyThreadState * ThreadSpecificData ;
@@ -212,9 +213,10 @@ typedef PyThreadState *ThreadSpecificData;
212213static PyThreadState * tcl_tstate = NULL ;
213214#endif
214215
216+
215217#define ACQUIRE_TCL_LOCK \
216218if (tcl_lock) {\
217- if (tcl_lock_thread_ident == PyThread_get_thread_ident()) {\
219+ if (tcl_lock_thread_ident == PyThread_get_thread_ident()) { \
218220 tcl_lock_reentry_count++; \
219221 if(!tcl_lock_reentry_count) \
220222 Py_FatalError("Tcl lock reentry count overflow"); \
@@ -234,12 +236,13 @@ if (tcl_lock){\
234236 }\
235237}
236238
239+
237240#define ENTER_TCL \
238- { PyThreadState *tstate = PyThreadState_Get();\
241+ { PyThreadState *tstate = PyThreadState_Get(); \
239242 ENTER_TCL_CUSTOM_TSTATE(tstate)
240243
241244#define ENTER_TCL_CUSTOM_TSTATE (tstate ) \
242- Py_BEGIN_ALLOW_THREADS\
245+ Py_BEGIN_ALLOW_THREADS \
243246 ACQUIRE_TCL_LOCK; tcl_tstate = tstate;
244247
245248#define LEAVE_TCL \
0 commit comments