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/svc/startd/method.c
          +++ new/usr/src/cmd/svc/startd/method.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  /*
  23   23   * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright 2011 Joyent Inc.
       24 + * Copyright 2018 Joyent, Inc.
  25   25   */
  26   26  
  27   27  /*
  28   28   * method.c - method execution functions
  29   29   *
  30   30   * This file contains the routines needed to run a method:  a fork(2)-exec(2)
  31   31   * invocation monitored using either the contract filesystem or waitpid(2).
  32   32   * (Plain fork1(2) support is provided in fork.c.)
  33   33   *
  34   34   * Contract Transfer
↓ open down ↓ 1073 lines elided ↑ open up ↑
1108 1108  method_thread(void *arg)
1109 1109  {
1110 1110          fork_info_t *info = arg;
1111 1111          restarter_inst_t *inst;
1112 1112          scf_handle_t    *local_handle;
1113 1113          scf_instance_t  *s_inst = NULL;
1114 1114          int r, exit_code;
1115 1115          boolean_t retryable;
1116 1116          restarter_str_t reason;
1117 1117  
     1118 +        (void) pthread_setname_np(pthread_self(), "method");
     1119 +
1118 1120          assert(0 <= info->sf_method_type && info->sf_method_type <= 2);
1119 1121  
1120 1122          /* Get (and lock) the restarter_inst_t. */
1121 1123          inst = inst_lookup_by_id(info->sf_id);
1122 1124  
1123 1125          assert(inst->ri_method_thread != 0);
1124 1126          assert(instance_in_transition(inst) == 1);
1125 1127  
1126 1128          /*
1127 1129           * We cannot leave this function with inst in transition, because
↓ open down ↓ 139 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX