summaryrefslogtreecommitdiff
path: root/sysdeps/hurd/pt-destroy-specific.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2017-12-29 15:01:46 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2017-12-29 15:01:46 +0100
commit218db6679aea0dcf05fb60566cef6e18f706d9ba (patch)
tree3099f55335743748ff18bd435e4de25b22c8f54a /sysdeps/hurd/pt-destroy-specific.c
parent0a69b89843ec466fa20c994a29d13de6a45c3acb (diff)
parent7d4a84731cd80a1ef711c83535c6340f0e2b143f (diff)
Merge branch 'master' into 2.262.26
Diffstat (limited to 'sysdeps/hurd/pt-destroy-specific.c')
-rw-r--r--sysdeps/hurd/pt-destroy-specific.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sysdeps/hurd/pt-destroy-specific.c b/sysdeps/hurd/pt-destroy-specific.c
index f7896e5..642c61c 100644
--- a/sysdeps/hurd/pt-destroy-specific.c
+++ b/sysdeps/hurd/pt-destroy-specific.c
@@ -19,14 +19,12 @@
#include <pthread.h>
#include <stdlib.h>
-#include <hurd/ihash.h>
#include <pt-internal.h>
void
__pthread_destroy_specific (struct __pthread *thread)
{
- error_t err;
int i;
int seen_one;
@@ -43,18 +41,17 @@ __pthread_destroy_specific (struct __pthread *thread)
__pthread_mutex_lock (&__pthread_key_lock);
- for (i = 0; i < __pthread_key_count; i ++)
+ for (i = 0; i < __pthread_key_count && i < thread->thread_specifics_size; i ++)
{
void *value;
if (__pthread_key_destructors[i] == PTHREAD_KEY_INVALID)
continue;
- value = hurd_ihash_find (thread->thread_specifics, i);
+ value = thread->thread_specifics[i];
if (value)
{
- err = hurd_ihash_remove (thread->thread_specifics, i);
- assert (err == 1);
+ thread->thread_specifics[i] = 0;
if (__pthread_key_destructors[i])
{
@@ -74,6 +71,7 @@ __pthread_destroy_specific (struct __pthread *thread)
sched_yield ();
}
- hurd_ihash_free (thread->thread_specifics);
+ free (thread->thread_specifics);
thread->thread_specifics = 0;
+ thread->thread_specifics_size = 0;
}