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

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libc/port/threads/pthread.c
          +++ new/usr/src/lib/libc/port/threads/pthread.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  /*
  27      - * Copyright 2016 Joyent, Inc.
       27 + * Copyright 2018 Joyent, Inc.
  28   28   */
  29   29  
  30   30  #include "lint.h"
  31   31  #include "thr_uberdata.h"
  32   32  
  33   33  /*
  34   34   * pthread_once related data
  35   35   * This structure is exported as pthread_once_t in pthread.h.
  36   36   * We export only the size of this structure. so check
  37   37   * pthread_once_t in pthread.h before making a change here.
↓ open down ↓ 83 lines elided ↑ open up ↑
 121  121  
 122  122          /* validate explicit scheduling attributes */
 123  123          if (ap->inherit == PTHREAD_EXPLICIT_SCHED &&
 124  124              (ap->policy == SCHED_SYS ||
 125  125              (pccp = get_info_by_policy(ap->policy)) == NULL ||
 126  126              ap->prio < pccp->pcc_primin || ap->prio > pccp->pcc_primax))
 127  127                  return (EINVAL);
 128  128  
 129  129          flag = ap->scope | ap->detachstate | ap->daemonstate | THR_SUSPENDED;
 130  130          error = _thrp_create(ap->stkaddr, ap->stksize, start_routine, arg,
 131      -            flag, &tid, ap->guardsize);
      131 +            flag, &tid, ap->guardsize, ap->name);
 132  132          if (error == 0) {
 133  133                  /*
 134  134                   * Record the original inheritence value for
 135  135                   * pthread_getattr_np(). We should always be able to find the
 136  136                   * thread.
 137  137                   */
 138  138                  (void) _thr_setinherit(tid, ap->inherit);
 139  139  
 140  140                  if (ap->inherit == PTHREAD_EXPLICIT_SCHED &&
 141  141                      (ap->policy != self->ul_policy ||
↓ open down ↓ 154 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX