This is the mail archive of the cygwin-patches@cygwin.com 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 1


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.

Thomas

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.

Attachment: pthread_fork_save_keys.patch
Description: Text document


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