[PATCH] reorganize list handling of fixable pthread objects

Thomas Pfaff tpfaff@gmx.net
Fri Feb 28 11:10:00 GMT 2003


Reorganize the list handling of the pthreads objects by using the List
template class and remove a lot of duplicate code.


2002-02-28  Thomas Pfaff  <tpfaff@gmx.net>

	* thread.h (class List): Move inline code inside of class
	declaration.
	(pthread_mutex::fixup_after_fork): Declare as static method.
	(pthread_mutex::FixupAfterFork(pthread_mutex*): New static method.
	(pthread_mutex::FixupAfterFork(void): New method.
	(pthread_mutex::mutexes): New static member.
	(pthread_cond::fixup_after_fork): Declare as static method.
	(pthread_cond::FixupAfterFork(pthread_cond*): New static method.
	(pthread_cond::FixupAfterFork(void): New method.
	(pthread_cond::conds): New static member.
	(pthread_rwlock::fixup_after_fork): Declare as static method.
	(pthread_rwlock::FixupAfterFork(pthread_rwlock*): New static
	method.
	(pthread_rwlock::FixupAfterFork(void): New method.
	(pthread_rwlock::rwlocks): New static member.
	(semaphore::fixup_after_fork): Declare as static method.
	(semaphore::FixupAfterFork(semaphore*): New static method.
	(semaphore::FixupAfterFork(void): New method.
	(semaphore::semaphores): New static member.
	(MTinterface::mutexs): Remove.
	(MTinterface::conds): Ditto.
	(MTinterface::rwlocks): Ditto.
	(MTinterface::semaphores): Ditto.
	(MTinterface::MTinterface): Remove initialization of removed
	member variables.
	* thread.cc (MTinterface::fixup_after_fork): Change
	fixup_after_fork for pthread objects.
	(pthread_cond::conds): Instantiate.
	(pthread_cond::pthread_cond): Use List::Insert rather than custom
	list code.
	(pthread_cond::~pthread_cond): Use List::Remove rather than custom
	list code.
	(pthread_cond::fixup:after_fork): Implement.
	(pthread_cond::FixupAfterFork): Rename old fixup_after_fork
	to FixupAfterFork.
	(pthread_rwlock::rwlocks): Instantiate.
	(pthread_rwlock::pthread_crwlock): Use List::Insert rather than
	custom list code.
	(pthread_rwlock::~pthread_rwlock): Use List::Remove rather than
	custom list code.
	(pthread_rwlock::fixup:after_fork): Implement.
	(pthread_rwlock::FixupAfterFork): Rename old fixup_after_fork
	to FixupAfterFork.
	(pthread_mutex::mutexes): Instantiate.
	(pthread_mutex::pthread_mutex): Use List::Insert rather than
	custom list code.
	(pthread_mutex::~pthread_mutex): Use List::Remove rather than
	custom list code.
	(pthread_mutex::fixup:after_fork): Implement.
	(pthread_mutex::FixupAfterFork): Rename old fixup_after_fork
	to FixupAfterFork.
	(semaphore::conds): Instantiate.
	(semaphore::semaphore): Use List::Insert rather than custom list
	code.
	(semaphores::~semaphore): Use List::Remove rather than custom list
	code.
	(semaphore::fixup:after_fork): Implement.
	(semaphore::FixupAfterFork): Rename old fixup_after_fork to
	FixupAfterFork.



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pthread_fixups.patch
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20030228/99bffdde/attachment.ksh>


More information about the Cygwin-patches mailing list