This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
[perl5.git] / thread.h
CommitLineData
d6376244
JH
1/* thread.h
2 *
ae53e38e 3 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
31ab2e0d 4 * by Larry Wall and others
d6376244
JH
5 *
6 * You may distribute under the terms of either the GNU General Public
7 * License or the Artistic License, as specified in the README file.
8 *
9 */
10
4d1ff10f 11#if defined(USE_5005THREADS) || defined(USE_ITHREADS)
12ca11f6 12
fd8cd3a3
DS
13#if defined(VMS)
14#include <builtins.h>
15#endif
16
ea0efc06 17#ifdef WIN32
d55594ae
GS
18# include <win32thread.h>
19#else
2986a63f
JH
20#ifdef NETWARE
21# include <nw5thread.h>
22#else
0d85d877 23# ifdef OLD_PTHREADS_API /* Here be dragons. */
ba869deb
GS
24# define DETACH(t) \
25 STMT_START { \
cb0e10e2
NC
26 int _eC_; \
27 if ((_eC_ = pthread_detach(&(t)->self))) { \
ba869deb 28 MUTEX_UNLOCK(&(t)->mutex); \
cb0e10e2
NC
29 Perl_croak_nocontext("panic: DETACH (%d) [%s:%d]", \
30 _eC_, __FILE__, __LINE__); \
ba869deb 31 } \
ea0efc06 32 } STMT_END
ba869deb
GS
33
34# define PERL_GET_CONTEXT Perl_get_context()
35# define PERL_SET_CONTEXT(t) Perl_set_context((void*)t)
36
0d85d877
JH
37# define PTHREAD_GETSPECIFIC_INT
38# ifdef DJGPP
39# define pthread_addr_t any_t
40# define NEED_PTHREAD_INIT
6dc3770d 41# define PTHREAD_CREATE_JOINABLE (1)
0d85d877
JH
42# endif
43# ifdef __OPEN_VM
44# define pthread_addr_t void *
45# endif
750300e4
JH
46# ifdef OEMVS
47# define pthread_addr_t void *
750300e4
JH
48# define pthread_create(t,a,s,d) pthread_create(t,&(a),s,d)
49# define pthread_keycreate pthread_key_create
50# endif
0d85d877
JH
51# ifdef VMS
52# define pthread_attr_init(a) pthread_attr_create(a)
53# define PTHREAD_ATTR_SETDETACHSTATE(a,s) pthread_setdetach_np(a,s)
6dc3770d 54# define PTHREAD_CREATE(t,a,s,d) pthread_create(t,a,s,d)
0d85d877
JH
55# define pthread_key_create(k,d) pthread_keycreate(k,(pthread_destructor_t)(d))
56# define pthread_mutexattr_init(a) pthread_mutexattr_create(a)
9bbd4fab 57# define pthread_mutexattr_settype(a,t) pthread_mutexattr_setkind_np(a,t)
0d85d877 58# endif
2eb25c99
JH
59# if defined(__hpux) && defined(__ux_version) && __ux_version <= 1020
60# define pthread_attr_init(a) pthread_attr_create(a)
61 /* XXX pthread_setdetach_np() missing in DCE threads on HP-UX 10.20 */
10617789 62# define PTHREAD_ATTR_SETDETACHSTATE(a,s) (0)
2eb25c99
JH
63# define PTHREAD_CREATE(t,a,s,d) pthread_create(t,a,s,d)
64# define pthread_key_create(k,d) pthread_keycreate(k,(pthread_destructor_t)(d))
65# define pthread_mutexattr_init(a) pthread_mutexattr_create(a)
66# define pthread_mutexattr_settype(a,t) pthread_mutexattr_setkind_np(a,t)
67# endif
750300e4 68# if defined(DJGPP) || defined(__OPEN_VM) || defined(OEMVS)
0d85d877
JH
69# define PTHREAD_ATTR_SETDETACHSTATE(a,s) pthread_attr_setdetachstate(a,&(s))
70# define YIELD pthread_yield(NULL)
71# endif
0d85d877 72# endif
2eb25c99 73# if !defined(__hpux) || !defined(__ux_version) || __ux_version > 1020
1cfa4ec7 74# define pthread_mutexattr_default NULL
0d85d877 75# define pthread_condattr_default NULL
2eb25c99 76# endif
2986a63f 77#endif /* NETWARE */
0d85d877
JH
78#endif
79
80#ifndef PTHREAD_CREATE
81/* You are not supposed to pass NULL as the 2nd arg of PTHREAD_CREATE(). */
82# define PTHREAD_CREATE(t,a,s,d) pthread_create(t,&(a),s,d)
83#endif
84
85#ifndef PTHREAD_ATTR_SETDETACHSTATE
86# define PTHREAD_ATTR_SETDETACHSTATE(a,s) pthread_attr_setdetachstate(a,s)
d55594ae 87#endif
1cfa4ec7 88
ef4af2be
JH
89#ifndef PTHREAD_CREATE_JOINABLE
90# ifdef OLD_PTHREAD_CREATE_JOINABLE
91# define PTHREAD_CREATE_JOINABLE OLD_PTHREAD_CREATE_JOINABLE
92# else
93# define PTHREAD_CREATE_JOINABLE 0 /* Panic? No, guess. */
94# endif
95#endif
96
5cbe9849 97#ifdef DGUX
95036ac7 98# define THREAD_CREATE_NEEDS_STACK (32*1024)
5cbe9849
JH
99#endif
100
4ae695b1
NC
101#ifdef __VMS
102 /* Default is 1024 on VAX, 8192 otherwise */
103# define THREAD_CREATE_NEEDS_STACK (32*1024)
104#endif
105
7f3d1cf1
BH
106#ifdef I_MACH_CTHREADS
107
108/* cthreads interface */
109
110/* #include <mach/cthreads.h> is in perl.h #ifdef I_MACH_CTHREADS */
111
ba869deb
GS
112#define MUTEX_INIT(m) \
113 STMT_START { \
114 *m = mutex_alloc(); \
115 if (*m) { \
116 mutex_init(*m); \
117 } else { \
cb0e10e2
NC
118 Perl_croak_nocontext("panic: MUTEX_INIT [%s:%d]", \
119 __FILE__, __LINE__); \
ba869deb
GS
120 } \
121 } STMT_END
122
123#define MUTEX_LOCK(m) mutex_lock(*m)
ba869deb 124#define MUTEX_UNLOCK(m) mutex_unlock(*m)
ba869deb
GS
125#define MUTEX_DESTROY(m) \
126 STMT_START { \
127 mutex_free(*m); \
128 *m = 0; \
129 } STMT_END
130
131#define COND_INIT(c) \
132 STMT_START { \
133 *c = condition_alloc(); \
134 if (*c) { \
135 condition_init(*c); \
136 } \
137 else { \
cb0e10e2
NC
138 Perl_croak_nocontext("panic: COND_INIT [%s:%d]", \
139 __FILE__, __LINE__); \
ba869deb
GS
140 } \
141 } STMT_END
7f3d1cf1
BH
142
143#define COND_SIGNAL(c) condition_signal(*c)
144#define COND_BROADCAST(c) condition_broadcast(*c)
145#define COND_WAIT(c, m) condition_wait(*c, *m)
ba869deb
GS
146#define COND_DESTROY(c) \
147 STMT_START { \
148 condition_free(*c); \
149 *c = 0; \
150 } STMT_END
7f3d1cf1
BH
151
152#define THREAD_CREATE(thr, f) (thr->self = cthread_fork(f, thr), 0)
153#define THREAD_POST_CREATE(thr)
154
155#define THREAD_RET_TYPE any_t
156#define THREAD_RET_CAST(x) ((any_t) x)
157
158#define DETACH(t) cthread_detach(t->self)
159#define JOIN(t, avp) (*(avp) = (AV *)cthread_join(t->self))
160
ba869deb
GS
161#define PERL_SET_CONTEXT(t) cthread_set_data(cthread_self(), t)
162#define PERL_GET_CONTEXT cthread_data(cthread_self())
7f3d1cf1
BH
163
164#define INIT_THREADS cthread_init()
165#define YIELD cthread_yield()
ba869deb 166#define ALLOC_THREAD_KEY NOOP
e1b5da64 167#define FREE_THREAD_KEY NOOP
7f3d1cf1
BH
168#define SET_THREAD_SELF(thr) (thr->self = cthread_self())
169
170#endif /* I_MACH_CTHREADS */
171
1cfa4ec7 172#ifndef YIELD
e7a4f449
JH
173# ifdef SCHED_YIELD
174# define YIELD SCHED_YIELD
175# else
176# ifdef HAS_SCHED_YIELD
177# define YIELD sched_yield()
178# else
179# ifdef HAS_PTHREAD_YIELD
180 /* pthread_yield(NULL) platforms are expected
181 * to have #defined YIELD for themselves. */
182# define YIELD pthread_yield()
183# endif
184# endif
185# endif
9731c6ca 186#endif
11343788 187
227c31c3
JH
188#ifdef __hpux
189# define MUTEX_INIT_NEEDS_MUTEX_ZEROED
190#endif
191
ea0efc06 192#ifndef MUTEX_INIT
ba869deb
GS
193
194# ifdef MUTEX_INIT_NEEDS_MUTEX_ZEROED
227c31c3 195 /* Temporary workaround, true bug is deeper. --jhi 1999-02-25 */
ba869deb 196# define MUTEX_INIT(m) \
227c31c3 197 STMT_START { \
cb0e10e2 198 int _eC_; \
227c31c3 199 Zero((m), 1, perl_mutex); \
cb0e10e2
NC
200 if ((_eC_ = pthread_mutex_init((m), pthread_mutexattr_default))) \
201 Perl_croak_nocontext("panic: MUTEX_INIT (%d) [%s:%d]", \
202 _eC_, __FILE__, __LINE__); \
227c31c3 203 } STMT_END
ba869deb
GS
204# else
205# define MUTEX_INIT(m) \
ea0efc06 206 STMT_START { \
cb0e10e2
NC
207 int _eC_; \
208 if ((_eC_ = pthread_mutex_init((m), pthread_mutexattr_default))) \
209 Perl_croak_nocontext("panic: MUTEX_INIT (%d) [%s:%d]", \
210 _eC_, __FILE__, __LINE__); \
ea0efc06 211 } STMT_END
ba869deb
GS
212# endif
213
214# define MUTEX_LOCK(m) \
215 STMT_START { \
cb0e10e2
NC
216 int _eC_; \
217 if ((_eC_ = pthread_mutex_lock((m)))) \
218 Perl_croak_nocontext("panic: MUTEX_LOCK (%d) [%s:%d]", \
219 _eC_, __FILE__, __LINE__); \
cea2e8a9 220 } STMT_END
ba869deb 221
efc57feb 222# define MUTEX_UNLOCK(m) \
ba869deb 223 STMT_START { \
cb0e10e2
NC
224 int _eC_; \
225 if ((_eC_ = pthread_mutex_unlock((m)))) \
226 Perl_croak_nocontext("panic: MUTEX_UNLOCK (%d) [%s:%d]", \
227 _eC_, __FILE__, __LINE__); \
ea0efc06 228 } STMT_END
ba869deb
GS
229
230# define MUTEX_DESTROY(m) \
231 STMT_START { \
cb0e10e2
NC
232 int _eC_; \
233 if ((_eC_ = pthread_mutex_destroy((m)))) \
234 Perl_croak_nocontext("panic: MUTEX_DESTROY (%d) [%s:%d]", \
235 _eC_, __FILE__, __LINE__); \
ea0efc06
MB
236 } STMT_END
237#endif /* MUTEX_INIT */
238
239#ifndef COND_INIT
ba869deb 240# define COND_INIT(c) \
ea0efc06 241 STMT_START { \
cb0e10e2
NC
242 int _eC_; \
243 if ((_eC_ = pthread_cond_init((c), pthread_condattr_default))) \
244 Perl_croak_nocontext("panic: COND_INIT (%d) [%s:%d]", \
245 _eC_, __FILE__, __LINE__); \
ea0efc06 246 } STMT_END
ba869deb
GS
247
248# define COND_SIGNAL(c) \
249 STMT_START { \
cb0e10e2
NC
250 int _eC_; \
251 if ((_eC_ = pthread_cond_signal((c)))) \
252 Perl_croak_nocontext("panic: COND_SIGNAL (%d) [%s:%d]", \
253 _eC_, __FILE__, __LINE__); \
ea0efc06 254 } STMT_END
ba869deb
GS
255
256# define COND_BROADCAST(c) \
257 STMT_START { \
cb0e10e2
NC
258 int _eC_; \
259 if ((_eC_ = pthread_cond_broadcast((c)))) \
260 Perl_croak_nocontext("panic: COND_BROADCAST (%d) [%s:%d]", \
261 _eC_, __FILE__, __LINE__); \
ea0efc06 262 } STMT_END
ba869deb
GS
263
264# define COND_WAIT(c, m) \
265 STMT_START { \
cb0e10e2
NC
266 int _eC_; \
267 if ((_eC_ = pthread_cond_wait((c), (m)))) \
268 Perl_croak_nocontext("panic: COND_WAIT (%d) [%s:%d]", \
269 _eC_, __FILE__, __LINE__); \
ea0efc06 270 } STMT_END
ba869deb
GS
271
272# define COND_DESTROY(c) \
273 STMT_START { \
cb0e10e2
NC
274 int _eC_; \
275 if ((_eC_ = pthread_cond_destroy((c)))) \
276 Perl_croak_nocontext("panic: COND_DESTROY (%d) [%s:%d]", \
277 _eC_, __FILE__, __LINE__); \
ea0efc06
MB
278 } STMT_END
279#endif /* COND_INIT */
33f46ff6 280
f826a10b 281/* DETACH(t) must only be called while holding t->mutex */
ea0efc06 282#ifndef DETACH
ba869deb
GS
283# define DETACH(t) \
284 STMT_START { \
cb0e10e2
NC
285 int _eC_; \
286 if ((_eC_ = pthread_detach((t)->self))) { \
ba869deb 287 MUTEX_UNLOCK(&(t)->mutex); \
cb0e10e2
NC
288 Perl_croak_nocontext("panic: DETACH (%d) [%s:%d]", \
289 _eC_, __FILE__, __LINE__); \
ba869deb 290 } \
ea0efc06
MB
291 } STMT_END
292#endif /* DETACH */
33f46ff6 293
ea0efc06 294#ifndef JOIN
ba869deb
GS
295# define JOIN(t, avp) \
296 STMT_START { \
cb0e10e2
NC
297 int _eC_; \
298 if ((_eC_ = pthread_join((t)->self, (void**)(avp)))) \
299 Perl_croak_nocontext("panic: pthread_join (%d) [%s:%d]", \
300 _eC_, __FILE__, __LINE__); \
ea0efc06
MB
301 } STMT_END
302#endif /* JOIN */
303
0953243c
JH
304/* Use an unchecked fetch of thread-specific data instead of a checked one.
305 * It would fail if the key were bogus, but if the key were bogus then
306 * Really Bad Things would be happening anyway. --dan */
026b9da6 307#if (defined(__ALPHA) && (__VMS_VER >= 70000000)) || \
5b7ea690 308 (defined(__alpha) && defined(__osf__) && !defined(__GNUC__)) /* Available only on >= 4.0 */
8b8b35ab
JH
309# define HAS_PTHREAD_UNCHECKED_GETSPECIFIC_NP /* Configure test needed */
310#endif
311
312#ifdef HAS_PTHREAD_UNCHECKED_GETSPECIFIC_NP
313# define PTHREAD_GETSPECIFIC(key) pthread_unchecked_getspecific_np(key)
314#else
2b5fe2c1 315# define PTHREAD_GETSPECIFIC(key) pthread_getspecific(key)
8b8b35ab
JH
316#endif
317
318#ifndef PERL_GET_CONTEXT
319# define PERL_GET_CONTEXT PTHREAD_GETSPECIFIC(PL_thr_key)
ba869deb
GS
320#endif
321
322#ifndef PERL_SET_CONTEXT
323# define PERL_SET_CONTEXT(t) \
324 STMT_START { \
cb0e10e2
NC
325 int _eC_; \
326 if ((_eC_ = pthread_setspecific(PL_thr_key, (void *)(t)))) \
327 Perl_croak_nocontext("panic: pthread_setspecific (%d) [%s:%d]", \
328 _eC_, __FILE__, __LINE__); \
ea0efc06 329 } STMT_END
ba869deb 330#endif /* PERL_SET_CONTEXT */
ea0efc06 331
1feb2720
GS
332#ifndef INIT_THREADS
333# ifdef NEED_PTHREAD_INIT
334# define INIT_THREADS pthread_init()
335# endif
0d85d877 336#endif
ea0efc06 337
ba869deb
GS
338#ifndef ALLOC_THREAD_KEY
339# define ALLOC_THREAD_KEY \
340 STMT_START { \
8c6f7913 341 if (pthread_key_create(&PL_thr_key, 0)) { \
d7559646 342 write(2, STR_WITH_LEN("panic: pthread_key_create failed\n")); \
c44d3fdb
GS
343 exit(1); \
344 } \
ba869deb
GS
345 } STMT_END
346#endif
347
e1b5da64
GS
348#ifndef FREE_THREAD_KEY
349# define FREE_THREAD_KEY \
350 STMT_START { \
351 pthread_key_delete(PL_thr_key); \
352 } STMT_END
353#endif
354
50dd6e57 355#ifndef PTHREAD_ATFORK
144e72cb
RS
356# ifdef HAS_PTHREAD_ATFORK
357# define PTHREAD_ATFORK(prepare,parent,child) \
de992003 358 pthread_atfork(prepare,parent,child)
144e72cb 359# else
8ff9412f
RS
360# define PTHREAD_ATFORK(prepare,parent,child) \
361 NOOP
144e72cb 362# endif
50dd6e57
GS
363#endif
364
1feb2720
GS
365#ifndef THREAD_RET_TYPE
366# define THREAD_RET_TYPE void *
367# define THREAD_RET_CAST(p) ((void *)(p))
368#endif /* THREAD_RET */
369
4d1ff10f 370#if defined(USE_5005THREADS)
1feb2720 371
940cb80d 372/* Accessor for per-thread SVs */
1feb2720 373# define THREADSV(i) (thr->threadsvp[i])
940cb80d
MB
374
375/*
376 * LOCK_SV_MUTEX and UNLOCK_SV_MUTEX are performance-critical. Here, we
377 * try only locking them if there may be more than one thread in existence.
378 * Systems with very fast mutexes (and/or slow conditionals) may wish to
379 * remove the "if (threadnum) ..." test.
b099ddc0 380 * XXX do NOT use C<if (PL_threadnum) ...> -- it sets up race conditions!
940cb80d 381 */
1feb2720
GS
382# define LOCK_SV_MUTEX MUTEX_LOCK(&PL_sv_mutex)
383# define UNLOCK_SV_MUTEX MUTEX_UNLOCK(&PL_sv_mutex)
384# define LOCK_STRTAB_MUTEX MUTEX_LOCK(&PL_strtab_mutex)
385# define UNLOCK_STRTAB_MUTEX MUTEX_UNLOCK(&PL_strtab_mutex)
386# define LOCK_CRED_MUTEX MUTEX_LOCK(&PL_cred_mutex)
387# define UNLOCK_CRED_MUTEX MUTEX_UNLOCK(&PL_cred_mutex)
4755096e
GS
388# define LOCK_FDPID_MUTEX MUTEX_LOCK(&PL_fdpid_mutex)
389# define UNLOCK_FDPID_MUTEX MUTEX_UNLOCK(&PL_fdpid_mutex)
631cfb58
GS
390# define LOCK_SV_LOCK_MUTEX MUTEX_LOCK(&PL_sv_lock_mutex)
391# define UNLOCK_SV_LOCK_MUTEX MUTEX_UNLOCK(&PL_sv_lock_mutex)
11343788 392
33f46ff6 393/* Values and macros for thr->flags */
605e5515
MB
394#define THRf_STATE_MASK 7
395#define THRf_R_JOINABLE 0
396#define THRf_R_JOINED 1
397#define THRf_R_DETACHED 2
398#define THRf_ZOMBIE 3
399#define THRf_DEAD 4
f93b4edd 400
458fb581 401#define THRf_DID_DIE 8
07b73707 402
f826a10b 403/* ThrSTATE(t) and ThrSETSTATE(t) must only be called while holding t->mutex */
458fb581 404#define ThrSTATE(t) ((t)->flags & THRf_STATE_MASK)
f93b4edd 405#define ThrSETSTATE(t, s) STMT_START { \
605e5515 406 (t)->flags &= ~THRf_STATE_MASK; \
33f46ff6 407 (t)->flags |= (s); \
bf49b057 408 DEBUG_S(PerlIO_printf(Perl_debug_log, \
605e5515 409 "thread %p set to state %d\n", (t), (s))); \
f93b4edd
MB
410 } STMT_END
411
412typedef struct condpair {
f826a10b
MB
413 perl_mutex mutex; /* Protects all other fields */
414 perl_cond owner_cond; /* For when owner changes at all */
415 perl_cond cond; /* For cond_signal and cond_broadcast */
416 Thread owner; /* Currently owning thread */
f93b4edd
MB
417} condpair_t;
418
419#define MgMUTEXP(mg) (&((condpair_t *)(mg->mg_ptr))->mutex)
420#define MgOWNERCONDP(mg) (&((condpair_t *)(mg->mg_ptr))->owner_cond)
421#define MgCONDP(mg) (&((condpair_t *)(mg->mg_ptr))->cond)
422#define MgOWNER(mg) ((condpair_t *)(mg->mg_ptr))->owner
423
4d1ff10f 424#endif /* USE_5005THREADS */
7223e9d8
JH
425
426# define LOCK_DOLLARZERO_MUTEX MUTEX_LOCK(&PL_dollarzero_mutex)
427# define UNLOCK_DOLLARZERO_MUTEX MUTEX_UNLOCK(&PL_dollarzero_mutex)
428
4d1ff10f 429#endif /* USE_5005THREADS || USE_ITHREADS */
1feb2720
GS
430
431#ifndef MUTEX_LOCK
432# define MUTEX_LOCK(m)
433#endif
434
1feb2720
GS
435#ifndef MUTEX_UNLOCK
436# define MUTEX_UNLOCK(m)
437#endif
1feb2720
GS
438
439#ifndef MUTEX_INIT
440# define MUTEX_INIT(m)
441#endif
442
443#ifndef MUTEX_DESTROY
444# define MUTEX_DESTROY(m)
445#endif
446
447#ifndef COND_INIT
448# define COND_INIT(c)
449#endif
450
451#ifndef COND_SIGNAL
452# define COND_SIGNAL(c)
453#endif
454
455#ifndef COND_BROADCAST
456# define COND_BROADCAST(c)
457#endif
458
459#ifndef COND_WAIT
460# define COND_WAIT(c, m)
461#endif
462
463#ifndef COND_DESTROY
464# define COND_DESTROY(c)
465#endif
466
467#ifndef LOCK_SV_MUTEX
468# define LOCK_SV_MUTEX
469#endif
470
471#ifndef UNLOCK_SV_MUTEX
472# define UNLOCK_SV_MUTEX
473#endif
474
475#ifndef LOCK_STRTAB_MUTEX
476# define LOCK_STRTAB_MUTEX
477#endif
478
479#ifndef UNLOCK_STRTAB_MUTEX
480# define UNLOCK_STRTAB_MUTEX
481#endif
482
483#ifndef LOCK_CRED_MUTEX
484# define LOCK_CRED_MUTEX
485#endif
486
487#ifndef UNLOCK_CRED_MUTEX
488# define UNLOCK_CRED_MUTEX
489#endif
490
4755096e
GS
491#ifndef LOCK_FDPID_MUTEX
492# define LOCK_FDPID_MUTEX
493#endif
494
495#ifndef UNLOCK_FDPID_MUTEX
496# define UNLOCK_FDPID_MUTEX
497#endif
498
631cfb58
GS
499#ifndef LOCK_SV_LOCK_MUTEX
500# define LOCK_SV_LOCK_MUTEX
501#endif
502
503#ifndef UNLOCK_SV_LOCK_MUTEX
504# define UNLOCK_SV_LOCK_MUTEX
505#endif
506
7223e9d8
JH
507#ifndef LOCK_DOLLARZERO_MUTEX
508# define LOCK_DOLLARZERO_MUTEX
509#endif
510
511#ifndef UNLOCK_DOLLARZERO_MUTEX
512# define UNLOCK_DOLLARZERO_MUTEX
513#endif
514
ba869deb 515/* THR, SET_THR, and dTHR are there for compatibility with old versions */
1feb2720 516#ifndef THR
ba869deb
GS
517# define THR PERL_GET_THX
518#endif
519
520#ifndef SET_THR
521# define SET_THR(t) PERL_SET_THX(t)
1feb2720
GS
522#endif
523
524#ifndef dTHR
525# define dTHR dNOOP
526#endif
527
528#ifndef INIT_THREADS
529# define INIT_THREADS NOOP
530#endif