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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/ldapcachemgr/cachemgr_change.c
          +++ new/usr/src/cmd/ldapcachemgr/cachemgr_change.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
       24 + *
       25 + * Copyright 2018 Joyent, Inc.
  24   26   */
  25   27  
  26   28  #include <strings.h>
  27   29  #include <stdlib.h>
  28   30  #include <syslog.h>
  29   31  #include <errno.h>
  30   32  #include <libintl.h>
  31   33  #include <door.h>
  32   34  #include <sys/types.h>
  33   35  #include <sys/stat.h>
  34   36  #include <fcntl.h>
  35   37  #include <procfs.h>
       38 +#include <pthread.h>
  36   39  #include "cachemgr.h"
  37   40  
  38   41  extern admin_t  current_admin;
  39   42  
  40   43  #define CLEANUP_WAIT_TIME 60
  41   44  
  42   45  typedef enum cleanup_type {
  43   46          CLEANUP_ALL     = 1,
  44   47          CLEANUP_BY_PID  = 2
  45   48  } cleanup_type_t;
↓ open down ↓ 482 lines elided ↑ open up ↑
 528  531   * else it calls cleanup_threads once and exits.
 529  532   */
 530  533  void *
 531  534  chg_cleanup_waiting_threads(void *arg)
 532  535  {
 533  536          cleanup_op_t *op = (cleanup_op_t *)arg;
 534  537          cleanup_type_t type = 0;
 535  538          pid_t   pid;
 536  539          int     always = 1, waiting;
 537  540  
      541 +        (void) pthread_setname_np(pthread_self(), "chg_cleanup_thr");
      542 +
 538  543          if (op == NULL) {
 539  544                  waiting = 1;
 540  545                  type = CLEANUP_ALL;
 541  546                  pid = 0;
 542  547          } else {
 543  548                  waiting = 0;
 544  549                  type = op->type;
 545  550                  pid = op->pid;
 546  551          }
 547  552  
↓ open down ↓ 131 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX