From owner-freebsd-current Sat May 30 22:01:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA02726 for freebsd-current-outgoing; Sat, 30 May 1998 22:01:42 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from cimlogic.com.au (cimlog.lnk.telstra.net [139.130.51.31]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA02713 for ; Sat, 30 May 1998 22:01:38 -0700 (PDT) (envelope-from jb@cimlogic.com.au) Received: (from jb@localhost) by cimlogic.com.au (8.8.8/8.8.7) id PAA13433; Sun, 31 May 1998 15:09:57 +1000 (EST) (envelope-from jb) From: John Birrell Message-Id: <199805310509.PAA13433@cimlogic.com.au> Subject: Re: pthreads and thread-specific? In-Reply-To: <199805310254.TAA18874@rah.star-gate.com> from Amancio Hasty at "May 30, 98 07:54:35 pm" To: hasty@rah.star-gate.com (Amancio Hasty) Date: Sun, 31 May 1998 15:09:57 +1000 (EST) Cc: jb@cimlogic.com.au, current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Amancio Hasty wrote: > Hi John, > > It looks like the threads are waiting on a dead thread... > > I stuck this in uthread_info: [...] I don't think you needed the outer loop. Chuckle. > for (itr = 0; itr < PTHREAD_DESTRUCTOR_ITERATIONS; itr++) { [...] > > DEAD THREADS > > Thread 0x8050800 prio 64 [/usr/src/lib/libc_r/uthread/uthread_exit.c:176] Hmmm, so Elvis really isn't dead. He's just deadlocked waiting on a spinlock. 8-) For the thread to be dead, it must have completed the cleanup. There is only one place where it sets it's state to PS_DEAD and that is after all exit processing has been completed and it has removed itself from the list of active threads. As far as I can see, the _spinlock/_atomic_unlock calls are correctly paired in src/lib/libc_r/uthread/uthread_spec.c, so it looks like the _atomic_unlock call hasn't done it's job. Is the _atomic_unlock linked into the process from libc_r, or has another function of the same name been linked in first? You are linking with gcc -pthread on a -current system, aren't you? -- John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/ CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message