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


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24  *
  25  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.


  27  */
  28 
  29 #ifndef _THREAD_H
  30 #define _THREAD_H
  31 
  32 /*
  33  * thread.h:
  34  * definitions needed to use the thread interface except synchronization.
  35  * use <synch.h> for thread synchronization.
  36  */
  37 
  38 #ifndef _ASM
  39 #include <sys/signal.h>
  40 #include <sys/time.h>
  41 #include <synch.h>
  42 #endif  /* _ASM */
  43 
  44 #ifdef __cplusplus
  45 extern "C" {
  46 #endif


  70  * the definition of thr_stksegment() is not strict ansi-c since stack_t is
  71  * not in the strict ansi-c name space. Hence, include the prototype for
  72  * thr_stksegment() only if strict ansi-c conformance is not turned on.
  73  */
  74 #if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
  75 extern int thr_stksegment(stack_t *);
  76 #endif
  77 
  78 extern int thr_main(void);
  79 extern int thr_kill(thread_t, int);
  80 extern int thr_suspend(thread_t);
  81 extern int thr_continue(thread_t);
  82 extern void thr_yield(void);
  83 extern int thr_setprio(thread_t, int);
  84 extern int thr_getprio(thread_t, int *);
  85 extern int thr_keycreate(thread_key_t *, void(*)(void *));
  86 extern int thr_keycreate_once(thread_key_t *, void(*)(void *));
  87 extern int thr_setspecific(thread_key_t, void *);
  88 extern int thr_getspecific(thread_key_t, void **);
  89 extern size_t thr_min_stack(void);


  90 
  91 #endif /* _ASM */
  92 
  93 #define THR_MIN_STACK   thr_min_stack()
  94 /*
  95  * thread flags (one word bit mask)
  96  */
  97 /*
  98  * POSIX.1c Note:
  99  * THR_BOUND is defined same as PTHREAD_SCOPE_SYSTEM in <pthread.h>
 100  * THR_DETACHED is defined same as PTHREAD_CREATE_DETACHED in <pthread.h>
 101  * Any changes in these definitions should be reflected in <pthread.h>
 102  */
 103 #define THR_BOUND               0x00000001      /* = PTHREAD_SCOPE_SYSTEM */
 104 #define THR_NEW_LWP             0x00000002
 105 #define THR_DETACHED            0x00000040      /* = PTHREAD_CREATE_DETACHED */
 106 #define THR_SUSPENDED           0x00000080
 107 #define THR_DAEMON              0x00000100
 108 
 109 /*


   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24  *
  25  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  *
  28  * Copyright 2018 Joyent, Inc.
  29  */
  30 
  31 #ifndef _THREAD_H
  32 #define _THREAD_H
  33 
  34 /*
  35  * thread.h:
  36  * definitions needed to use the thread interface except synchronization.
  37  * use <synch.h> for thread synchronization.
  38  */
  39 
  40 #ifndef _ASM
  41 #include <sys/signal.h>
  42 #include <sys/time.h>
  43 #include <synch.h>
  44 #endif  /* _ASM */
  45 
  46 #ifdef __cplusplus
  47 extern "C" {
  48 #endif


  72  * the definition of thr_stksegment() is not strict ansi-c since stack_t is
  73  * not in the strict ansi-c name space. Hence, include the prototype for
  74  * thr_stksegment() only if strict ansi-c conformance is not turned on.
  75  */
  76 #if !defined(_STRICT_STDC) || defined(__EXTENSIONS__)
  77 extern int thr_stksegment(stack_t *);
  78 #endif
  79 
  80 extern int thr_main(void);
  81 extern int thr_kill(thread_t, int);
  82 extern int thr_suspend(thread_t);
  83 extern int thr_continue(thread_t);
  84 extern void thr_yield(void);
  85 extern int thr_setprio(thread_t, int);
  86 extern int thr_getprio(thread_t, int *);
  87 extern int thr_keycreate(thread_key_t *, void(*)(void *));
  88 extern int thr_keycreate_once(thread_key_t *, void(*)(void *));
  89 extern int thr_setspecific(thread_key_t, void *);
  90 extern int thr_getspecific(thread_key_t, void **);
  91 extern size_t thr_min_stack(void);
  92 extern int thr_getname(thread_t, char *, size_t);
  93 extern int thr_setname(thread_t, const char *);
  94 
  95 #endif /* _ASM */
  96 
  97 #define THR_MIN_STACK   thr_min_stack()
  98 /*
  99  * thread flags (one word bit mask)
 100  */
 101 /*
 102  * POSIX.1c Note:
 103  * THR_BOUND is defined same as PTHREAD_SCOPE_SYSTEM in <pthread.h>
 104  * THR_DETACHED is defined same as PTHREAD_CREATE_DETACHED in <pthread.h>
 105  * Any changes in these definitions should be reflected in <pthread.h>
 106  */
 107 #define THR_BOUND               0x00000001      /* = PTHREAD_SCOPE_SYSTEM */
 108 #define THR_NEW_LWP             0x00000002
 109 #define THR_DETACHED            0x00000040      /* = PTHREAD_CREATE_DETACHED */
 110 #define THR_SUSPENDED           0x00000080
 111 #define THR_DAEMON              0x00000100
 112 
 113 /*