3 This is intended to be usable independently from Python.
4 The implementation for system foobar is in a file thread_foobar.h
5 which is included by this file dependent on config settings.
6 Stuff shared by all thread_*.h files is collected here. */
10 /* pyconfig.h may or may not define DL_IMPORT */
11 #ifndef DL_IMPORT /* declarations for DLL import/export */
12 #define DL_IMPORT(RTYPE) RTYPE
15 #ifndef DONT_HAVE_STDIO_H
23 extern char *getenv(const char *);
28 #define _USING_POSIX4A_DRAFT6
32 #ifndef HAVE_PTHREAD_H /* XXX Need to check in configure.in */
40 #define _POSIX_THREADS
43 #ifndef _POSIX_THREADS
50 #define SOLARIS_THREADS
53 #if defined(sun) && !defined(SOLARIS_THREADS)
57 #if defined(__MWERKS__) && !defined(__BEOS__)
58 #define _POSIX_THREADS
61 #endif /* _POSIX_THREADS */
65 static int thread_debug
= 0;
66 #define dprintf(args) ((thread_debug & 1) && printf args)
67 #define d2printf(args) ((thread_debug & 8) && printf args)
70 #define d2printf(args)
73 static int initialized
;
75 static void PyThread__init_thread(void); /* Forward */
77 void PyThread_init_thread(void)
80 char *p
= getenv("THREADDEBUG");
84 thread_debug
= atoi(p
);
92 dprintf(("PyThread_init_thread called\n"));
93 PyThread__init_thread();
97 #include "thread_sgi.h"
100 #ifdef SOLARIS_THREADS
101 #include "thread_solaris.h"
105 #include "thread_lwp.h"
109 #include "thread_pth.h"
112 #ifdef _POSIX_THREADS
113 #include "thread_pthread.h"
117 #include "thread_cthread.h"
121 #include "thread_nt.h"
125 #include "thread_os2.h"
129 #include "thread_beos.h"
133 #include "thread_wince.h"
137 #ifdef FOOBAR_THREADS
138 #include "thread_foobar.h"