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]

Re: pthread_testcancel() causes SEGV


On Thu, 2002-08-08 at 04:54, Jason Tishler wrote:
> Thomas,
> 
> On Wed, Aug 07, 2002 at 09:34:14AM +0200, Thomas Pfaff wrote:
> > Thanks for tracking it down.
> 
> No problem.  Thanks for the quick turn around on the patch.  I tested it
> and can confirm that it fixes the ipc-daemon service startup problem.

Jason, 
sorry for the *cough* long delay. 

the attached patch is the 'right way' to deal with this issue IMO. It
also gives us full pthread* support for threads created using the win32
CreateThread call (although I won't officially support that at this
point :}).

Generally speaking, when you find yourself writing the same bit of code
twice, the design is wrong. Anyway, enough said:

ChangeLog
2002-09-11  Robert Collins  <rbtcollins@hotmail.com>

	* init.cc (dll_entry): On thread detach, if the thread hasn't
	exit()ed, do so.
	* thread.cc (pthread::self): Instantiate a new pthread object 
	when called and none exists.
	(pthread::precreate): Factor out common code.
	(pthread::postcreate): Ditto.
	(pthread::create): Ditto.
	(pthread::exit): Remove the TLS value when we exit to prevent
	double exits.
	* thread.h (pthread): Declare pre- and post-create.

Rob

Attachment: pthread_self_fix.patch
Description: Text document

Attachment: signature.asc
Description: This is a digitally signed message part


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