Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com X-Authentication-Warning: atacama.four-d.de: mail set sender to using -f Date: Wed, 7 Aug 2002 09:34:14 +0200 (=?ISO-8859-1?Q?Westeurop=E4ische_Sommerzeit?=) From: Thomas Pfaff To: cygwin-developers AT cygwin DOT com Subject: Re: pthread_testcancel() causes SEGV In-Reply-To: <20020806183632.GA1892@tishler.net> Message-ID: X-X-Sender: pfaff AT antarctica DOT intern DOT net MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 6 Aug 2002, Jason Tishler wrote: > I annotated pthread::self() as follows: > > pthread * > pthread::self () > { > pthread *p = (pthread *) TlsGetValue > (MT_INTERFACE->thread_self_dwTlsIndex); > debug_printf ("pthread::self: p = %x, i = %ld", p, > MT_INTERFACE->thread_self_dwTlsIndex); > return p; > } > > When starting ipc-daemon, I get the following: > > 87 3097903 [unknown (0xD8C)] ipc-daemon 920 pthread::self: > pthread::self: p = 0, i = 4 > > instead of something like the following (from a non-SCM test case): > > 85 121609 [main] open 2504 pthread::self: pthread::self: p = > 610CD61C, i = 4 > This seems to a problem with all treads that are not the mainthread nor created by pthread_create. I will enhance pthread_self to automatically create a pointer to the pthread class if it is not present. Thanks for tracking it down. Thomas