[PATCH] pthread_fork Part 1

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

Rob suggested to break the pthread_fork patch into smaller chunks. Ths is
part 1 providing a fork save key value handling.
The patch will add a linked list of keys to MTinterface and a fork buffer
in pthread_key where the key values are passed between parent and child.


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

	* fork.cc (fork_child): Remove MTinterface::fixup_after_fork call.
	It is done in __pthread_atforkchild now.
	* thread.cc (MTinterface::Init): Initialize keys to NULL.
	(MTinterface::fixup_before_fork): New method.
	(MTinterface::fixup_after_fork): Fixup keys after fork.
	(pthread_key::pthread_key): Insert key in list.
	(pthread_key::~pthread_key): Remove key from list.
	(pthread_key::fixup_before_fork): New method. Save key value in
	fork_buf for child process.
	(pthread_key::fixup_after_fork): New method. Recreate TLS storage
	and restore value.
	(__pthread_atforkprepare): Add MTinterface::fixup_before_fork.
	(__pthread_atforkchild): Add MTinterface::fixup_after_fork.
	* thread.h (pthread_key::fork_buf): New member.
	(pthread_key::next): Ditto.
	(pthread_key::fixup_before_fork): New method.
	(pthread_key::fixup_after_fork): Ditto.
	(MTinterface::keys): New member.
	(MTinterface::fixup_before_fork): New method.

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

More information about the Cygwin-patches mailing list