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] updated mutex implementation


This patch contains an update of my mutex implementation that should apply
to current.

2002-09-23  Thomas Pfaff <tpfaff@gmx.net>

	* include/pthread.h: Change default mutex type to errorcheck.
	* thread.cc (pthread_cond::TimedWait): Fix mutex unlock call.
	(pthread_mutex::pthread_mutex): Rewrite.
	(pthread_mutex::~pthread_mutex): Ditto.
	(pthread_mutex::Lock): Ditto.
	(pthread_mutex::TryLock): Ditto.
	(pthread_mutex::UnLock): Ditto.
	(pthread_mutex::Destroy): New method.
	(pthread_mutex::SetOwner): Ditto.
	(pthread_mutex::LockRecursive): Ditto.
	(pthread_mutex::fixup_after_fork): Restore mutex after fork.
	(__pthread_mutex_destroy): Call pthread_mutex::Destroy to destroy
	mutex.
	(__pthread_mutexattr_settype): Allow errorchecking and recursive
	types.
	* thread.h (MUTEX_LOCK_COUNTER_INITIAL): New define.
	(pthread_mutex::criticalsection): Remove.
	(pthread_mutex::lock_counter): New member.
	(pthread_mutex::recursion_counter): Ditto.
	(pthread_mutex::owner): Ditto.
	(pthread_mutex::type): Ditto.
	(pthread_mutex::Destroy): New method.
	(pthread_mutex::SetOwner): Ditto.
	(pthread_mutex::LockRecursive): Ditto.



Attachment: pthread_mutex.patch
Description: Text document


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