Skip to content

Commit 41ac64c

Browse files
committed
cosmetic changes for readability
1 parent 10c6711 commit 41ac64c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Modules/_tkinter.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ _get_tcl_lib_path()
180180
181181
Sometimes, it is necessary to have both the Python lock and the Tcl lock.
182182
(For example, when transferring data between the Tcl interpreter and/or
183-
objects and Python objects.) To avoid deadlocks, when acquiring, we always
184-
acquire the Tcl lock first, then the Python lock. The additional macros for
183+
objects and Python objects.) To avoid deadlocks, when acquiring, we always
184+
acquire the Tcl lock first, then the Python lock. The additional macros for
185185
finer lock control are: ENTER_OVERLAP acquires the Python lock (and restores
186186
the thread state) when already holding the Tcl lock; LEAVE_OVERLAP releases
187187
the Python lock and keeps the Tcl lock; and LEAVE_OVERLAP_TCL releases the
@@ -222,6 +222,7 @@ static PyThread_type_lock tcl_lock = 0;
222222
static unsigned long tcl_lock_thread_ident = 0;
223223
static unsigned int tcl_lock_reentry_count = 0;
224224

225+
225226
#ifdef TCL_THREADS
226227
static Tcl_ThreadDataKey state_key;
227228
typedef PyThreadState *ThreadSpecificData;
@@ -231,9 +232,10 @@ typedef PyThreadState *ThreadSpecificData;
231232
static PyThreadState *tcl_tstate = NULL;
232233
#endif
233234

235+
234236
#define ACQUIRE_TCL_LOCK \
235237
if (tcl_lock) {\
236-
if (tcl_lock_thread_ident == PyThread_get_thread_ident()) {\
238+
if (tcl_lock_thread_ident == PyThread_get_thread_ident()) { \
237239
tcl_lock_reentry_count++; \
238240
if(!tcl_lock_reentry_count) \
239241
Py_FatalError("Tcl lock reentry count overflow"); \
@@ -253,12 +255,13 @@ if (tcl_lock){\
253255
}\
254256
}
255257

258+
256259
#define ENTER_TCL \
257-
{ PyThreadState *tstate = PyThreadState_Get();\
260+
{ PyThreadState *tstate = PyThreadState_Get(); \
258261
ENTER_TCL_CUSTOM_TSTATE(tstate)
259262

260263
#define ENTER_TCL_CUSTOM_TSTATE(tstate) \
261-
Py_BEGIN_ALLOW_THREADS\
264+
Py_BEGIN_ALLOW_THREADS \
262265
ACQUIRE_TCL_LOCK; tcl_tstate = tstate;
263266

264267
#define LEAVE_TCL \

0 commit comments

Comments
 (0)