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

Split Close
Expand all
Collapse all
          --- old/usr/src/head/pthread.h
          +++ new/usr/src/head/pthread.h
↓ 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 2014 Garrett D'Amore <garrett@damore.org>
  24      - * Copyright 2016 Joyent, Inc.
       24 + * Copyright 2018 Joyent, Inc.
  25   25   *
  26   26   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  27   27   * Use is subject to license terms.
  28   28   */
  29   29  
  30   30  #ifndef _PTHREAD_H
  31   31  #define _PTHREAD_H
  32   32  
  33   33  #include <sys/feature_tests.h>
  34   34  
↓ open down ↓ 97 lines elided ↑ open up ↑
 132  132  /*
 133  133   * The key to be created by pthread_key_create_once_np()
 134  134   * must be statically initialized with PTHREAD_ONCE_KEY_NP.
 135  135   * This must be the same as THR_ONCE_KEY in <thread.h>
 136  136   */
 137  137  #define PTHREAD_ONCE_KEY_NP     (pthread_key_t)(-1)
 138  138  
 139  139  /* barriers */
 140  140  #define PTHREAD_BARRIER_SERIAL_THREAD   -2
 141  141  
      142 +/* For pthread_{get,set}name_np(). */
      143 +#define PTHREAD_MAX_NAMELEN_NP (32)
      144 +
 142  145  #ifndef _ASM
 143  146  
 144  147  /*
 145  148   * cancellation cleanup structure
 146  149   */
 147  150  typedef struct _cleanup {
 148  151          uintptr_t       pthread_cleanup_pad[4];
 149  152  } _cleanup_t;
 150  153  
 151  154  void    __pthread_cleanup_push(void (*)(void *), void *, caddr_t, _cleanup_t *);
↓ open down ↓ 50 lines elided ↑ open up ↑
 202  205  extern int pthread_attr_setinheritsched(pthread_attr_t *, int);
 203  206  extern int pthread_attr_getinheritsched(const pthread_attr_t *_RESTRICT_KYWD,
 204  207          int *_RESTRICT_KYWD);
 205  208  extern int pthread_attr_setschedpolicy(pthread_attr_t *, int);
 206  209  extern int pthread_attr_getschedpolicy(const pthread_attr_t *_RESTRICT_KYWD,
 207  210          int *_RESTRICT_KYWD);
 208  211  extern int pthread_attr_setschedparam(pthread_attr_t *_RESTRICT_KYWD,
 209  212                  const struct sched_param *_RESTRICT_KYWD);
 210  213  extern int pthread_attr_getschedparam(const pthread_attr_t *_RESTRICT_KYWD,
 211  214                  struct sched_param *_RESTRICT_KYWD);
      215 +extern int pthread_attr_setname_np(pthread_attr_t *_RESTRICT_KYWD,
      216 +    const char *_RESTRICT_KYWD);
      217 +extern int pthread_attr_getname_np(pthread_attr_t *_RESTRICT_KYWD,
      218 +    char *_RESTRICT_KYWD, size_t);
 212  219  extern int pthread_create(pthread_t *_RESTRICT_KYWD,
 213  220                  const pthread_attr_t *_RESTRICT_KYWD, void * (*)(void *),
 214  221                  void *_RESTRICT_KYWD);
 215  222  extern int pthread_once(pthread_once_t *, void (*)(void));
 216  223  extern int pthread_join(pthread_t, void **);
 217  224  extern int pthread_detach(pthread_t);
 218  225  extern void pthread_exit(void *) __NORETURN;
 219  226  extern int pthread_cancel(pthread_t);
 220  227  extern int pthread_setschedparam(pthread_t, int, const struct sched_param *);
 221  228  extern int pthread_getschedparam(pthread_t, int *_RESTRICT_KYWD,
↓ open down ↓ 2 lines elided ↑ open up ↑
 224  231  extern int pthread_setcancelstate(int, int *);
 225  232  extern int pthread_setcanceltype(int, int *);
 226  233  extern void pthread_testcancel(void);
 227  234  extern int pthread_equal(pthread_t, pthread_t);
 228  235  extern int pthread_key_create(pthread_key_t *, void (*)(void *));
 229  236  extern int pthread_key_create_once_np(pthread_key_t *, void (*)(void *));
 230  237  extern int pthread_key_delete(pthread_key_t);
 231  238  extern int pthread_setspecific(pthread_key_t, const void *);
 232  239  extern void *pthread_getspecific(pthread_key_t);
 233  240  extern pthread_t pthread_self(void);
      241 +extern int pthread_setname_np(pthread_t, const char *);
      242 +extern int pthread_getname_np(pthread_t, char *, size_t);
 234  243  
 235  244  /*
 236  245   * function prototypes - synchronization related calls
 237  246   */
 238  247  extern int pthread_mutexattr_init(pthread_mutexattr_t *);
 239  248  extern int pthread_mutexattr_destroy(pthread_mutexattr_t *);
 240  249  extern int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
 241  250  extern int pthread_mutexattr_getpshared(
 242  251          const pthread_mutexattr_t *_RESTRICT_KYWD, int *_RESTRICT_KYWD);
 243  252  extern int pthread_mutexattr_setprotocol(pthread_mutexattr_t *, int);
↓ open down ↓ 107 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX