[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Sat Jun 12 16:41:45 CEST 2010


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	10/06/12 16:41:45

Modified files:
	cm3/m3-libs/m3core/src/thread/PTHREAD/: ThreadPThreadC.c 

Log message:
	Pick SIG_SUSPEND for Alpha/OSF1/Tru64.
	Otherwise pthreads fails to compile for it, due to
	picking a non-constant.
	
	Here are some of the choices:
	
	/usr/include/signal.h:
	#define SIGUSR1	  30	/* user defined signal 1 */
	#define SIGUSR2	  31	/* user defined signal 2 */
	#define SIGRTMIN  (sysconf(131))
	#define SIGRTMAX  (sysconf(132))
	
	bash-4.1$ ./a.out
	33 48
	
	#include <stdio.h>
	#include <signal.h>
	
	int main(int argc, char** argv)
	{
	printf("%ld %ld\n", (long)SIGRTMIN, (long)SIGRTMAX);
	return 0;
	}
	
	Using 33, 48 seems dangerous -- does it vary per machine/OS version?
	
	Diff here is:
	<#elif defined(SIGRTMAX) && !defined(__osf__)
	>#elif defined(SIGRTMAX) && !defined(__osf__)
	/* This might be a function call, in which case try _SIGRTMAX or initializing
	it somewhere. */
	EXTERN_CONST int SIG_SUSPEND = SIGRTMAX;
	#elif defined(SIGUSR2)
	EXTERN_CONST int SIG_SUSPEND = SIGUSR2;
	
	so we end up using SIGUSR2, which is the same as on Solaris and maybe
	others.
	
	Note that OSF/1 and Darwin share a common base in Mach.
	And therefore "direct suspend" is probably a good easy idea here?
	mach_suspend/resume are in the headers, but I haven't found
	how to get the mach thread for a pthread, or the current mach
	thread, to compare see if they match.
	
	I'm more comfortable using the common code though actually.
	esp. since I haven't written any of this.




More information about the M3commit mailing list