Print this page
8158 Want named threads API
9857 proc manpages should have LIBRARY section

@@ -19,10 +19,12 @@
  * CDDL HEADER END
  */
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright 2018 Joyent, Inc.
  */
 
 #include <strings.h>
 #include <stdlib.h>
 #include <syslog.h>

@@ -31,10 +33,11 @@
 #include <door.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <procfs.h>
+#include <pthread.h>
 #include "cachemgr.h"
 
 extern admin_t  current_admin;
 
 #define CLEANUP_WAIT_TIME 60

@@ -533,10 +536,12 @@
         cleanup_op_t *op = (cleanup_op_t *)arg;
         cleanup_type_t type = 0;
         pid_t   pid;
         int     always = 1, waiting;
 
+        (void) pthread_setname_np(pthread_self(), "chg_cleanup_thr");
+
         if (op == NULL) {
                 waiting = 1;
                 type = CLEANUP_ALL;
                 pid = 0;
         } else {