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_getldap.c
          +++ new/usr/src/cmd/ldapcachemgr/cachemgr_getldap.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  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 (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
       23 + *
       24 + * Copyright 2018 Joyent, Inc.
  23   25   */
  24   26  
  25   27  #include <assert.h>
  26   28  #include <errno.h>
  27   29  #include <memory.h>
  28   30  #include <signal.h>
  29   31  #include <stdlib.h>
  30   32  #include <stdio.h>
  31   33  #include <string.h>
  32   34  #include <libintl.h>
↓ open down ↓ 1591 lines elided ↑ open up ↑
1624 1626          int                     is_creating;
1625 1627          int                     err, no_server_good = FALSE;
1626 1628          int                     server_removed = FALSE;
1627 1629          int                     fall_thru = FALSE;
1628 1630          static struct timespec  timeout;
1629 1631          struct timespec         new_timeout;
1630 1632          struct timeval          tp;
1631 1633          static time_t           prev_refresh = 0, next_refresh = 0;
1632 1634          ns_server_status_t              changed = 0;
1633 1635  
     1636 +        (void) pthread_setname_np(pthread_self(), "getldap_serverinfo");
     1637 +
1634 1638          if (current_admin.debug_level >= DBG_ALL) {
1635 1639                  logit("getldap_serverInfo_op()...\n");
1636 1640          }
1637 1641          switch (op) {
1638 1642          case INFO_OP_CREATE:
1639 1643                  if (current_admin.debug_level >= DBG_ALL) {
1640 1644                          logit("operation is INFO_OP_CREATE...\n");
1641 1645                  }
1642 1646  
1643 1647                  /*
↓ open down ↓ 891 lines elided ↑ open up ↑
2535 2539          int             sleeptime;
2536 2540          struct timeval  tp;
2537 2541          long            expire = 0;
2538 2542          void            **paramVal = NULL;
2539 2543          ns_ldap_error_t *errorp;
2540 2544          int             always = 1, err;
2541 2545          int             first_time = 1;
2542 2546          int             sig_done = 0;
2543 2547          int             dbg_level;
2544 2548  
     2549 +        (void) pthread_setname_np(pthread_self(), "getldap_refresh");
     2550 +
2545 2551          if (current_admin.debug_level >= DBG_ALL) {
2546 2552                  logit("getldap_refresh()...\n");
2547 2553          }
2548 2554  
2549 2555          /*
2550 2556           * wait for an available server
2551 2557           */
2552 2558          while (sig_done == 0) {
2553 2559                  (void) mutex_lock(&sig_mutex);
2554 2560                  sig_done = signal_done;
↓ open down ↓ 330 lines elided ↑ open up ↑
2885 2891   * program flow. It's meant to maintain the original program flow yet be
2886 2892   * non-blocking when it's contacting server.
2887 2893   */
2888 2894  static void *
2889 2895  remove_server_thread(void *arg)
2890 2896  {
2891 2897          char *addr = (char *)arg, *out = NULL;
2892 2898          int up;
2893 2899          rm_svr_t rms;
2894 2900  
     2901 +        (void) pthread_setname_np(pthread_self(), "remove_server");
     2902 +
2895 2903          up = contact_server(addr);
2896 2904  
2897 2905          rms.addr = addr;
2898 2906          rms.up = up;
2899 2907  
2900 2908          (void) getldap_serverInfo_op(INFO_OP_REMOVESERVER, (char *)&rms, &out);
2901 2909  
2902 2910          free(addr);
2903 2911  
2904 2912          thr_exit(NULL);
↓ open down ↓ 69 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX