summaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2017-07-09 20:21:08 +0000
committerchristos <christos@NetBSD.org>2017-07-09 20:21:08 +0000
commit4125aa296f5a136b65c5d49ddfc0f0912a98c0b0 (patch)
tree07bba1ca0b078fe3a997ec459dcea5662a3d6e00 /lib/libpthread
parent83b28bad5e6aa357d417064f9e98a8ef017ddf3c (diff)
PR/52386: Use the number of iterations we document.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/pthread_tsd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libpthread/pthread_tsd.c b/lib/libpthread/pthread_tsd.c
index baceae9c967..b395957aeed 100644
--- a/lib/libpthread/pthread_tsd.c
+++ b/lib/libpthread/pthread_tsd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_tsd.c,v 1.15 2015/08/25 13:46:23 pooka Exp $ */
+/* $NetBSD: pthread_tsd.c,v 1.16 2017/07/09 20:21:08 christos Exp $ */
/*-
* Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_tsd.c,v 1.15 2015/08/25 13:46:23 pooka Exp $");
+__RCSID("$NetBSD: pthread_tsd.c,v 1.16 2017/07/09 20:21:08 christos Exp $");
/* Functions and structures dealing with thread-specific data */
#include <errno.h>
@@ -332,7 +332,8 @@ pthread__destroy_tsd(pthread_t self)
* a while.''
*/
- iterations = 4; /* We're not required to try very hard */
+ /* We're not required to try very hard */
+ iterations = PTHREAD_DESTRUCTOR_ITERATIONS;
do {
done = 1;
for (i = 0; i < pthread_keys_max; i++) {
@@ -356,7 +357,7 @@ pthread__destroy_tsd(pthread_t self)
(*destructor)(val);
}
}
- } while (!done && iterations--);
+ } while (!done && --iterations);
self->pt_havespecific = 0;
pthread_mutex_lock(&self->pt_lock);