1 /* lthread.h - ldap threads header file */
6 #if defined( THREAD_SUNOS4_LWP )
7 /***********************************
9 * thread definitions for sunos4 *
11 ***********************************/
16 #include <lwp/stackdep.h>
18 typedef void *(*VFP)();
20 /* thread attributes and thread type */
21 typedef int pthread_attr_t;
22 typedef thread_t pthread_t;
24 /* default attr states */
25 #define pthread_mutexattr_default NULL
26 #define pthread_condattr_default NULL
28 /* thread state - joinable or not */
29 #define PTHREAD_CREATE_JOINABLE 0
30 #define PTHREAD_CREATE_DETACHED 1
31 /* thread scope - who is in scheduling pool */
32 #define PTHREAD_SCOPE_PROCESS 0
33 #define PTHREAD_SCOPE_SYSTEM 1
35 /* mutex attributes and mutex type */
36 typedef int pthread_mutexattr_t;
37 typedef mon_t pthread_mutex_t;
39 /* mutex and condition variable scope - process or system */
40 #define PTHREAD_SHARE_PRIVATE 0
41 #define PTHREAD_SHARE_PROCESS 1
43 /* condition variable attributes and condition variable type */
44 typedef int pthread_condattr_t;
45 typedef struct lwpcv {
50 #else /* end sunos4 */
52 #if defined( THREAD_SUNOS5_LWP )
53 /***********************************
55 * thread definitions for sunos5 *
57 ***********************************/
64 typedef void *(*VFP)();
66 /* sunos5 threads are preemptive */
67 #define PTHREAD_PREEMPTIVE 1
69 /* thread attributes and thread type */
70 typedef int pthread_attr_t;
71 typedef thread_t pthread_t;
73 /* default attr states */
74 #define pthread_mutexattr_default NULL
75 #define pthread_condattr_default NULL
77 /* thread state - joinable or not */
78 #define PTHREAD_CREATE_JOINABLE 0
79 #define PTHREAD_CREATE_DETACHED THR_DETACHED
80 /* thread scope - who is in scheduling pool */
81 #define PTHREAD_SCOPE_PROCESS 0
82 #define PTHREAD_SCOPE_SYSTEM THR_BOUND
84 /* mutex attributes and mutex type */
85 typedef int pthread_mutexattr_t;
86 typedef mutex_t pthread_mutex_t;
88 /* mutex and condition variable scope - process or system */
89 #define PTHREAD_SHARE_PRIVATE USYNC_THREAD
90 #define PTHREAD_SHARE_PROCESS USYNC_PROCESS
92 /* condition variable attributes and condition variable type */
93 typedef int pthread_condattr_t;
94 typedef cond_t pthread_cond_t;
96 #else /* end sunos5 */
98 #if defined( THREAD_MIT_PTHREADS )
99 /***********************************
101 * definitions for mit pthreads *
103 ***********************************/
109 #else /* end mit pthreads */
111 #if defined( THREAD_DCE_PTHREADS )
112 /***********************************
114 * definitions for mit pthreads *
116 ***********************************/
122 /* dce threads are preemptive */
123 #define PTHREAD_PREEMPTIVE 1
125 #define pthread_attr_init( a ) pthread_attr_create( a )
126 #define pthread_attr_destroy( a ) pthread_attr_delete( a )
127 #define pthread_attr_setdetachstate( a, b ) \
128 pthread_attr_setdetach_np( a, b )
130 #endif /* dce pthreads */
131 #endif /* mit pthreads */
137 /***********************************
139 * thread definitions for no *
140 * underlying library support *
142 ***********************************/
144 typedef void *(*VFP)();
146 /* thread attributes and thread type */
147 typedef int pthread_attr_t;
148 typedef int pthread_t;
150 /* default attr states */
151 #define pthread_mutexattr_default NULL
152 #define pthread_condattr_default NULL
154 /* thread state - joinable or not */
155 #define PTHREAD_CREATE_JOINABLE 0
156 #define PTHREAD_CREATE_DETACHED 0
157 /* thread scope - who is in scheduling pool */
158 #define PTHREAD_SCOPE_PROCESS 0
159 #define PTHREAD_SCOPE_SYSTEM 0
161 /* mutex attributes and mutex type */
162 typedef int pthread_mutexattr_t;
163 typedef int pthread_mutex_t;
165 /* mutex and condition variable scope - process or system */
166 #define PTHREAD_SHARE_PRIVATE 0
167 #define PTHREAD_SHARE_PROCESS 0
169 /* condition variable attributes and condition variable type */
170 typedef int pthread_condattr_t;
171 typedef int pthread_cond_t;
173 #endif /* no threads support */
174 #endif /* _LTHREAD_H */