[PATCH] pthread_fork Part 3

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


Pthread key destructor handling revised. IMHO it does not make sense to
handle two lists with keys, one with all keys, one with its destructors.
The destructors are now part of the key class.

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

	* init.cc (dll_entry): Remove FIXME block. Call
	MTinterface::on_thread_detach on DLL_THREAD_DETACH and on
	DLL_PROCESS_DETACH for the last terminating thread.
	* thread.cc (pthread_key_destructor) Remove all methods.
	(pthread_key_destructor_list): Ditto.
	(MT_INTERFACE): Move define to thread.h
	(MTinterface::on_thread_detach): Walk through keys list and run
	its value destructors.
	(pthread::exit): Remove MT_INTERFACE->destructors.IterateNull
	call. Key destructors are now run on thread detach.
	(pthread_key::pthread_key): Initialize destructor function
	pointer. Remove old destructor handling.
	(pthread_key::~pthread_key): Remove old destructor handling.
	(pthread_key::run_dtors): Run key destructors if defined and
	the value is not NULL.
	* thread.h (pthread_key::destructor): New member.
	(pthread_key::run_dtors): New method.
	(pthread_key_destructor) Remove class.
	(pthread_key_destructor_list): Ditto.
	(MTinterface::destructors): Remove member.
	(MTinterface::on_thread_detach): New method.
	MT_INTERFACE: Move from thread.cc to this location.

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


More information about the Cygwin-patches mailing list