[M3commit] CVS Update: cm3

Jay Krell jkrell at elego.de
Mon Apr 12 11:32:53 CEST 2010


CVSROOT:	/usr/cvs
Changes by:	jkrell at birch.	10/04/12 11:32:53

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

Log message:
	"rewrite" time conversions inline like so:
	
	#define BILLION (1000 * 1000 * 1000)
	
	struct timespec timeout;
	double n = { 0 };
	
	ZERO_MEMORY(timeout);
	timeout.tv_nsec = modf(m3timeout, &n) * BILLION;
	timeout.tv_sec = n;
	return pthread_cond_timedwait(cond, mutex, &timeout);
	
	modf splits a double into integer and fractional parts, returning fraction "directly" and integer into a double by pointer.




More information about the M3commit mailing list