Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread PR/52386: Use the number of iterations we doc...



details:   https://anonhg.NetBSD.org/src/rev/044fbb4d9d76
branches:  trunk
changeset: 825330:044fbb4d9d76
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jul 09 20:21:08 2017 +0000

description:
PR/52386: Use the number of iterations we document.

diffstat:

 lib/libpthread/pthread_tsd.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 56144b332503 -r 044fbb4d9d76 lib/libpthread/pthread_tsd.c
--- a/lib/libpthread/pthread_tsd.c      Sun Jul 09 19:37:33 2017 +0000
+++ b/lib/libpthread/pthread_tsd.c      Sun Jul 09 20:21:08 2017 +0000
@@ -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 @@
         * 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 @@
                                (*destructor)(val);
                        }
                }
-       } while (!done && iterations--);
+       } while (!done && --iterations);
 
        self->pt_havespecific = 0;
        pthread_mutex_lock(&self->pt_lock);



Home | Main Index | Thread Index | Old Index