[PATCH] pthread_key patch

Thomas Pfaff tpfaff@gmx.net
Thu Jul 4 23:50:00 GMT 2002

If somebody is interested why if find this patch neccessary with a posix
threaded gcc could read

At least the changes in pthread_key::get should be applied, peoble would
be very surprised if the value of errno or Win32LastError will be set to 0
behind her back.



2002-07-05  Thomas Pfaff  <tpfaff@gmx.net>

	* init.cc (dll_entry): Run the pthread_key destructors on thread
	and process detach. This will make sure that regardless a thread
	is created with pthread_create or CreateThread its eh context
	will be freed.
	* thread.cc: Moved #define MT_INTERFACE from thread.cc to
	(pthread_key_destructor_list::IterateNull): Run
	destructor only if value is not NULL.
	(pthread_key::get): Save and restore WIN32 LastError to avoid
	that Lasterror is cleared in the exception handling code.
	set_errno (0) removed.
	(__pthread_exit): Removed IterateNull call. This will be done
	during thread detach.
	* thread.h (pthread::cleanup_stack): Moved #define MT_INTERFACE
	user_data->threadinterface from thread.cc to this location.

More information about the Cygwin-patches mailing list