1 /***********************************************************
2 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the names of Stichting Mathematisch
12 Centrum or CWI not be used in advertising or publicity pertaining to
13 distribution of the software without specific, written prior permission.
15 STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
16 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
18 FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21 OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 ******************************************************************/
26 This is intended to be usable independently from Python.
27 The implementation for system foobar is in a file thread_foobar.h
28 which is included by this file dependent on config settings.
29 Stuff shared by all thread_*.h files is collected here. */
40 extern char *getenv();
46 #define _POSIX_THREADS
49 #ifndef _POSIX_THREADS
56 #define SOLARIS_THREADS
59 #if defined(sun) && !defined(SOLARIS_THREADS)
63 #endif /* _POSIX_THREADS */
69 #define _P2(v1,t1,v2,t2) (t1,t2)
73 #define _P1(v,t) (v) t;
74 #define _P2(v1,t1,v2,t2) (v1,v2) t1; t2;
78 static int thread_debug
= 0;
79 #define dprintf(args) ((thread_debug & 1) && printf args)
80 #define d2printf(args) ((thread_debug & 8) && printf args)
83 #define d2printf(args)
86 static int initialized
;
88 static void _init_thread(); /* Forward */
90 void init_thread
_P0()
93 char *p
= getenv("THREADDEBUG");
97 thread_debug
= atoi(p
);
105 dprintf(("init_thread called\n"));
110 #include "thread_sgi.h"
113 #ifdef SOLARIS_THREADS
114 #include "thread_solaris.h"
118 #include "thread_lwp.h"
121 #ifdef _POSIX_THREADS
122 #include "thread_pthread.h"
126 #include "thread_cthread.h"
130 #include "thread_nt.h"
134 #ifdef FOOBAR_THREADS
135 #include "thread_foobar.h"