Source-Changes-HG archive

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

[src/trunk]: src/lib/librumpuser use a probe result to decide which pthread_s...



details:   https://anonhg.NetBSD.org/src/rev/6602d6afbf24
branches:  trunk
changeset: 794665:6602d6afbf24
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Mar 21 12:28:54 2014 +0000

description:
use a probe result to decide which pthread_setname_np() to use

diffstat:

 lib/librumpuser/rumpuser_port.h |   5 ++++-
 lib/librumpuser/rumpuser_pth.c  |  16 +++++-----------
 2 files changed, 9 insertions(+), 12 deletions(-)

diffs (60 lines):

diff -r eae42bd8410b -r 6602d6afbf24 lib/librumpuser/rumpuser_port.h
--- a/lib/librumpuser/rumpuser_port.h   Fri Mar 21 12:07:10 2014 +0000
+++ b/lib/librumpuser/rumpuser_port.h   Fri Mar 21 12:28:54 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser_port.h,v 1.29 2014/02/25 20:58:18 pooka Exp $ */
+/*     $NetBSD: rumpuser_port.h,v 1.30 2014/03/21 12:28:54 pooka Exp $ */
 
 /*
  * Portability header for non-NetBSD platforms.
@@ -20,6 +20,9 @@
 #define PLATFORM_HAS_FSYNC_RANGE
 #define PLATFORM_HAS_NBSYSCTL
 #define PLATFORM_HAS_NBFILEHANDLE
+#ifndef HAVE_PTHREAD_SETNAME3
+#define HAVE_PTHREAD_SETNAME3
+#endif
 
 #define PLATFORM_HAS_STRSUFTOLL
 #define PLATFORM_HAS_SETGETPROGNAME
diff -r eae42bd8410b -r 6602d6afbf24 lib/librumpuser/rumpuser_pth.c
--- a/lib/librumpuser/rumpuser_pth.c    Fri Mar 21 12:07:10 2014 +0000
+++ b/lib/librumpuser/rumpuser_pth.c    Fri Mar 21 12:28:54 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser_pth.c,v 1.37 2014/03/21 12:07:10 pooka Exp $  */
+/*     $NetBSD: rumpuser_pth.c,v 1.38 2014/03/21 12:28:54 pooka Exp $  */
 
 /*
  * Copyright (c) 2007-2010 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
 #include "rumpuser_port.h"
 
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser_pth.c,v 1.37 2014/03/21 12:07:10 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_pth.c,v 1.38 2014/03/21 12:28:54 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/queue.h>
@@ -93,19 +93,13 @@
                nanosleep(&ts, NULL);
        }
 
-#if defined(__NetBSD__)
-       if (rv == 0 && thrname)
+#if defined(HAVE_PTHREAD_SETNAME_3)
+       if (rv == 0 && thrname) {
                pthread_setname_np(*ptidp, thrname, NULL);
-#elif defined(__linux__)
-       /*
-        * The pthread_setname_np() call varies from one Linux distro to
-        * another.  Comment out the call pending autoconf support.
-        */
-#if 0
+#elif defined(HAVE_PTHREAD_SETNAME_2)
        if (rv == 0 && thrname)
                pthread_setname_np(*ptidp, thrname);
 #endif
-#endif
 
        if (joinable) {
                assert(ptcookie);



Home | Main Index | Thread Index | Old Index