[M3commit] CVS Update: cm3

Antony Hosking hosking at elego.de
Thu Nov 29 06:07:08 CET 2007

CVSROOT:	/usr/cvs
Changes by:	hosking at birch.	07/11/29 06:07:08

Modified files:
	cm3/m3-libs/libm3/src/os/POSIX/: FSPosix.m3 ProcessPosix.m3 
	cm3/m3-libs/m3core/src/C/Common/: M3toC.m3 
	cm3/m3-libs/m3core/src/runtime/common/: RTAllocCnts.i3 
	cm3/m3-libs/m3core/src/thread/Common/: Scheduler.i3 
	cm3/m3-libs/m3core/src/thread/POSIX/: SchedulerPosix.i3 
	cm3/m3-libs/m3core/src/thread/PTHREAD/: SchedulerPosix.i3 
	cm3/m3-libs/m3core/src/thread/WIN32/: ThreadWin32.m3 

Log message:
	Move DisableSwitching/EnableSwitching from SchedulerPosix.i3 to Scheduler.i3.
	These need to be available for non-platform-specific code (such as M3toC --
	see below) to disable *user*-level thread switching for non-thread-safe code.
	Since ThreadWin32 and ThreadPThread don't have user-level switching (and library
	routines are system-thread-safe) these operations are no-ops for those targets.
	For ThreadPosix (user-level threads) the operations increment the inCritical
	This change permits a bug-fix for M3toC.CopyTtoS, which invoked Cstdlib.malloc
	without any protection against user-level thread switches, making it unsafe for
	user-level threads.
	These changes also permit significant improvement in the allocation sequences
	in RTAllocator.  RTAllocCnts are only enabled now when needed, and locks are
	taken only when counts are enabled.

More information about the M3commit mailing list