[Python-checkins] python/dist/src/Modules _tkinter.c,1.152,1.153

loewis@users.sourceforge.net loewis@users.sourceforge.net
2003年3月30日 00:45:00 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv28329/Modules
Modified Files:
	_tkinter.c 
Log Message:
Wrap thread stuff in WITH_THREAD. Fixes #704641.
Index: _tkinter.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -C2 -d -r1.152 -r1.153
*** _tkinter.c	30 Mar 2003 08:26:04 -0000	1.152
--- _tkinter.c	30 Mar 2003 08:44:58 -0000	1.153
***************
*** 330,334 ****
 }
 #endif /* MS_WINDOWS */
- #endif /* WITH_THREAD */
 
 /* Wait up to 1s for the mainloop to come up. */
--- 330,333 ----
***************
*** 350,353 ****
--- 349,353 ----
 	return 0;
 }
+ #endif /* WITH_THREAD */
 
 
***************
*** 625,628 ****
--- 625,629 ----
 	}
 #endif
+ #ifdef WITH_THREAD
 	if (v->threaded && tcl_lock) {
 	 /* If Tcl is threaded, we don't need the lock. */
***************
*** 630,633 ****
--- 631,635 ----
 	 tcl_lock = NULL;
 	}
+ #endif
 
 	v->BooleanType = Tcl_GetObjType("boolean");
***************
*** 1247,1250 ****
--- 1249,1253 ----
 	int flags = TCL_EVAL_DIRECT;
 
+ #ifdef WITH_THREAD
 	if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
 		/* We cannot call the command directly. Instead, we must
***************
*** 1273,1277 ****
 		}
 	}
! 	else {
 
 		objv = Tkapp_CallArgs(args, objStore, &objc);
--- 1276,1282 ----
 		}
 	}
! 	else 
! #endif
! 	{
 
 		objv = Tkapp_CallArgs(args, objStore, &objc);
***************
*** 1533,1536 ****
--- 1538,1542 ----
 	ev->res = &res;
 	ev->exc = &exc;
+ #ifdef WITH_THREAD
 	if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
 		/* The current thread is not the interpreter thread. Marshal
***************
*** 1544,1548 ****
 		Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->cond, &var_mutex);
 	}
! 	else {
 		/* Tcl is not threaded, or this is the interpreter thread. To
 		 perform the call, we must hold the TCL lock. To receive the
--- 1550,1556 ----
 		Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->cond, &var_mutex);
 	}
! 	else 
! #endif
! 	{
 		/* Tcl is not threaded, or this is the interpreter thread. To
 		 perform the call, we must hold the TCL lock. To receive the
***************
*** 2050,2056 ****
--- 2058,2066 ----
 	}
 
+ #ifdef WITH_THREAD
 	if (self->threaded && self->thread_id != Tcl_GetCurrentThread() &&
 	 !WaitForMainloop(self))
 		return NULL;
+ #endif
 
 	data = PyMem_NEW(PythonCmd_ClientData, 1);
***************
*** 2209,2212 ****
--- 2219,2223 ----
 		return NULL;
 
+ #ifdef WITH_THREAD
 	if (!self && !tcl_lock) {
 		/* We don't have the Tcl lock since Tcl is threaded. */
***************
*** 2216,2219 ****
--- 2227,2231 ----
 		return NULL;
 	}
+ #endif
 
 	if (self) {
***************
*** 2250,2253 ****
--- 2262,2266 ----
 		return NULL;
 
+ #ifdef WITH_THREAD
 	if (!self && !tcl_lock) {
 		/* We don't have the Tcl lock since Tcl is threaded. */
***************
*** 2257,2260 ****
--- 2270,2274 ----
 		return NULL;
 	}
+ #endif
 
 	if (self) {
***************
*** 2427,2430 ****
--- 2441,2445 ----
 	}
 
+ #ifdef WITH_THREAD
 	if (!self && !tcl_lock) {
 		/* We don't have the Tcl lock since Tcl is threaded. */
***************
*** 2434,2437 ****
--- 2449,2453 ----
 		return NULL;
 	}
+ #endif
 
 	if (self) {
***************
*** 2461,2464 ****
--- 2477,2481 ----
 		return NULL;
 
+ #ifdef WITH_THREAD
 	if (!self && !tcl_lock) {
 		/* We don't have the Tcl lock since Tcl is threaded. */
***************
*** 2468,2471 ****
--- 2485,2489 ----
 		return NULL;
 	}
+ #endif
 
 	if (self) {
***************
*** 2835,2839 ****
--- 2853,2859 ----
 #endif
 
+ #ifdef WITH_THREAD
 static PyThreadState *event_tstate = NULL;
+ #endif
 
 static int

AltStyle によって変換されたページ (->オリジナル) /