[PATCH] added locks in pthread code

Thomas Pfaff tpfaff@gmx.net
Thu Apr 25 02:33:00 GMT 2002


The patch will add locks via mutex around critical code to protect against
race conditions and fix __pthread_detach to cleanup when thread has
already terminated. This an incremental update again.

Greetings,
Thomas

2002-04-25  Thomas Pfaff  <tpfaff@gmx.net>

	* thread.h (pthread::mutex): new member
	* thread.cc (pthread::pthread): Set mutex to NULL.
	(pthread::~pthread): Destroy mutex.
	(pthread::create): Initialize mutex.
	(thread_init_wrapper): Protect against race.
	(__pthread_cleanup_push): Ditto.
	(__pthread_exit): Ditto.
	(__pthread_join): Ditto
	(__pthread_detach): Protect against race and cleanup if thread has
	already terminated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pthread_lock.patch
Type: application/octet-stream
Size: 4991 bytes
Desc: 
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20020425/b64bce03/attachment.obj>


More information about the Cygwin-patches mailing list