[PATCH] pthread_fork part 4

Thomas Pfaff tpfaff@gmx.net
Fri Aug 16 14:31:00 GMT 2002

MTinterface revised. The key handling for reents and thread self keys is
now done by pthread keys. This will make them fork save by default.
Threads will get a thread self pointer automatically if they do not have
one. Cleanup of pthread instances is now done by a key destructor

2002-08-16  Thomas Pfaff <tpfaff@gmx.net>

	* init.cc (dll_entry): Change due to new reent_key handling.
	* thread.cc (_reent_clib): Change due to new reent_key handling.
	Save and restore of Win32 LastError is no more needed.
	(_reent_winsup): Ditto.
	(MTinterface::Init): reents are now handled as pthread keys,
	explicit TlsAlloc is no more needed.
	Class members are now initialized in constructor.
	Set thread self pointer to mainthread if not forked.
	(MTinterface::fixup_after_fork): Reset threadcount to 1 after
	fork. Initialize thread self pointer.
	(pthread::self): Create thread self pointer if thread has been
	created outside the pthread scope.
	(pthread::destructor): New method to be set as key destructor
	(pthread::exit): Remove deletion of instance if thread is
	detached. This is done in the destructor now.
	(pthread::init_pthread): Initialize thread members for thread that
	has been created outside of the pthread scope.
	(pthread::thread_init_wrapper): Change due to new reent_key
	* thread.h (pthread::self): New argument auto_init.
	(pthread::init_pthread): New method.
	(pthread::destructor): New static method.
	(MTinterface::reent_index): Removed member.
	(MTinterface::thread_self_dwTlsIndex); Ditto.
	(MTinterface::reent_key): New member.
	(MTinterface::thread_self_key): Ditto.
	(MTinterface::MTinterface): Initialize all member variables.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: MTinterface.patch
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020816/d0e4ee8d/attachment.ksh>

More information about the Cygwin-patches mailing list