From owner-freebsd-threads@FreeBSD.ORG Wed Jun 9 07:40:05 2010 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 150A31065675 for ; Wed, 9 Jun 2010 07:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DF95B8FC19 for ; Wed, 9 Jun 2010 07:40:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o597e4T4080337 for ; Wed, 9 Jun 2010 07:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o597e4BG080336; Wed, 9 Jun 2010 07:40:04 GMT (envelope-from gnats) Date: Wed, 9 Jun 2010 07:40:04 GMT Message-Id: <201006090740.o597e4BG080336@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: dfilter@FreeBSD.ORG (dfilter service) Cc: Subject: Re: threads/135462: commit references a PR X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dfilter service List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2010 07:40:05 -0000 The following reply was made to PR threads/135462; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: threads/135462: commit references a PR Date: Wed, 9 Jun 2010 07:31:51 +0000 (UTC) Author: brian Date: Wed Jun 9 07:31:41 2010 New Revision: 208936 URL: http://svn.freebsd.org/changeset/base/208936 Log: MFC r197477 - clean up keys deleted via pthread_key_delete() PR: 135462 Approved by: re (kib) Nod timeout: davidxu Modified: stable/8/lib/libthr/thread/thr_spec.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/8/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:32 2010 (r208935) +++ stable/8/lib/libthr/thread/thr_spec.c Wed Jun 9 07:31:41 2010 (r208936) @@ -131,9 +131,19 @@ _thread_cleanupspecific(void) curthread->specific[key].data = NULL; curthread->specific_data_count--; } + else if (curthread->specific[key].data != NULL) { + /* + * This can happen if the key is deleted via + * pthread_key_delete without first setting the value + * to NULL in all threads. POSIX says that the + * destructor is not invoked in this case. + */ + curthread->specific[key].data = NULL; + curthread->specific_data_count--; + } /* - * If there is a destructore, call it + * If there is a destructor, call it * with the key table entry unlocked: */ if (destructor != NULL) { _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"