don't report error if key was deleted.

PR:	threads/135462
This commit is contained in:
David Xu 2009-09-25 00:15:30 +00:00
parent b101b127f3
commit daf3ced72b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=197477

View File

@ -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) {