[Python-checkins] CVS: python/dist/src/Modules signalmodule.c,2.56,2.57

Guido van Rossum python-dev@python.org
Mon, 18 Sep 2000 17:46:48 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv9822/Modules

Modified Files:
	signalmodule.c 
Log Message:
Make better use of GNU Pth -- patch by Andy Dustman.
I can't test this, so I'm just checking it in with blind faith in Andy.
I've tested that it doesn't broeak a non-Pth build on Linux.

Changes include:

- There's a --with-pth configure option.

- Instead of _GNU_PTH, we test for HAVE_PTH.

- Better signal handling.

- (The config.h.in file is regenerated in a slightly different order.)



Index: signalmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/signalmodule.c,v
retrieving revision 2.56
retrieving revision 2.57
diff -C2 -r2.56 -r2.57
*** signalmodule.c	2000/09/16 16:35:28	2.56
--- signalmodule.c	2000/09/19 00:46:46	2.57
***************
*** 63,66 ****
--- 63,69 ----
     thread.  XXX This is a hack.
  
+    GNU pth is a user-space threading library, and as such, all threads
+    run within the same process. In this case, if the currently running
+    thread is not the main_thread, send the signal to the main_thread.
  */
  
***************
*** 110,113 ****
--- 113,122 ----
  {
  #ifdef WITH_THREAD
+ #ifdef WITH_PTH
+ 	if (PyThread_get_thread_ident() != main_thread) {
+ 		pth_raise(*(pth_t *) main_thread, sig_num);
+ 		return;
+ 	}
+ #endif
  	/* See NOTES section above */
  	if (getpid() == main_pid) {