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_discovery.c
          +++ new/usr/src/cmd/ldapcachemgr/cachemgr_discovery.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  #ifdef SLP
  27   29  
  28   30  /*
  29   31   * This file contains all the dynamic server discovery functionality
  30   32   * for ldap_cachemgr. SLP is used to query the network for any changes
  31   33   * in the set of deployed LDAP servers.
  32   34   *
  33   35   * The algorithm used is outlined here:
↓ open down ↓ 498 lines elided ↑ open up ↑
 532  534  done:
 533  535          if (h) SLPClose(h);
 534  536          if (fulltype) free(fulltype);
 535  537  }
 536  538  
 537  539  /*
 538  540   * This is the ldap_cachemgr entry point into SLP dynamic discovery. The
 539  541   * parameter 'r' should be a pointer to an unsigned int containing
 540  542   * the requested interval at which the network should be queried.
 541  543   */
 542      -void discover(void *r) {
      544 +void
      545 +discover(void *r) {
 543  546          unsigned short reqrefresh = *((unsigned int *)r);
 544  547  
      548 +        (void) pthread_setname_np(pthread_self(), "discover");
      549 +
 545  550          for (;;) {
 546  551              find_all_contexts("ldap",
 547  552                                  __cache_get_cfghandle,
 548  553                                  __cache_aggregate_params,
 549  554                                  __cache_set_cfghandle);
 550  555  
 551  556              if (current_admin.debug_level >= DBG_ALL) {
 552  557                  (void) logit(
 553  558                          "dynamic discovery: using refresh interval %d\n",
 554  559                          reqrefresh);
 555  560              }
 556  561  
 557  562              (void) sleep(reqrefresh);
 558  563          }
 559  564  }
 560  565  
 561  566  #endif /* SLP */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX