Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jun 2010 07:40:07 GMT
From:      dfilter@FreeBSD.ORG (dfilter service)
To:        freebsd-threads@FreeBSD.org
Subject:   Re: threads/135462: commit references a PR
Message-ID:  <201006090740.o597e7aI080433@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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:36:43 +0000 (UTC)

 Author: brian
 Date: Wed Jun  9 07:36:35 2010
 New Revision: 208937
 URL: http://svn.freebsd.org/changeset/base/208937
 
 Log:
   MFC r197477 - clean up keys deleted via pthread_key_delete()
   
   PR:		135462
 
 Modified:
   stable/7/lib/libthr/thread/thr_spec.c
 Directory Properties:
   stable/7/lib/libthr/   (props changed)
 
 Modified: stable/7/lib/libthr/thread/thr_spec.c
 ==============================================================================
 --- stable/7/lib/libthr/thread/thr_spec.c	Wed Jun  9 07:31:41 2010	(r208936)
 +++ stable/7/lib/libthr/thread/thr_spec.c	Wed Jun  9 07:36:35 2010	(r208937)
 @@ -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"
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006090740.o597e7aI080433>