This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] pthread_fork part 4

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 <>

	* (dll_entry): Change due to new reent_key handling.
	* (_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.

Attachment: MTinterface.patch
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]