[Python-checkins] CVS: python/dist/src/Python thread_cthread.h,2.15,2.16

Martin v. L?wis loewis@users.sourceforge.net
Tue, 01 Jan 2002 10:41:35 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv30638/Python

Modified Files:
	thread_cthread.h 
Log Message:
Patch #497098: build support for GNU/Hurd.


Index: thread_cthread.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/thread_cthread.h,v
retrieving revision 2.15
retrieving revision 2.16
diff -C2 -d -r2.15 -r2.16
*** thread_cthread.h	2001/10/16 21:13:49	2.15
--- thread_cthread.h	2002/01/01 18:41:33	2.16
***************
*** 1,5 ****
--- 1,10 ----
  
+ #ifdef MACH_C_THREADS
  #include <mach/cthreads.h>
+ #endif
  
+ #ifdef HURD_C_THREADS
+ #include <cthreads.h>
+ #endif
  
  /*
***************
*** 9,13 ****
  PyThread__init_thread(void)
  {
! 	cthread_init();
  }
  
--- 14,25 ----
  PyThread__init_thread(void)
  {
! #ifndef HURD_C_THREADS
! 	/* Roland McGrath said this should not be used since this is
! 	done while linking to threads */
! 	cthread_init(); 
! #else
! /* do nothing */
! 	;
! #endif
  }
  
***************
*** 128,135 ****
  	dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
  	if (waitflag) { 	/* blocking */
! 		mutex_lock(lock);
  		success = TRUE;
  	} else {		/* non blocking */
! 		success = mutex_try_lock(lock);
  	}
  	dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));
--- 140,147 ----
  	dprintf(("PyThread_acquire_lock(%p, %d) called\n", lock, waitflag));
  	if (waitflag) { 	/* blocking */
! 		mutex_lock((mutex_t)lock);
  		success = TRUE;
  	} else {		/* non blocking */
! 		success = mutex_try_lock((mutex_t)lock);
  	}
  	dprintf(("PyThread_acquire_lock(%p, %d) -> %d\n", lock, waitflag, success));