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 /* config.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 *);
32 #define _USING_POSIX4A_DRAFT6
36 #ifndef HAVE_PTHREAD_H /* XXX Need to check in configure.in */
44 #define _POSIX_THREADS
47 #ifndef _POSIX_THREADS
54 #define SOLARIS_THREADS
57 #if defined(sun) && !defined(SOLARIS_THREADS)
61 #if defined(__MWERKS__) && !defined(__BEOS__)
62 #define _POSIX_THREADS
65 #endif /* _POSIX_THREADS */
69 static int thread_debug
= 0;
70 #define dprintf(args) ((thread_debug & 1) && printf args)
71 #define d2printf(args) ((thread_debug & 8) && printf args)
74 #define d2printf(args)
77 static int initialized
;
79 static void PyThread__init_thread(void); /* Forward */
81 void PyThread_init_thread(void)
84 char *p
= getenv("THREADDEBUG");
88 thread_debug
= atoi(p
);
96 dprintf(("PyThread_init_thread called\n"));
97 PyThread__init_thread();
101 #include "thread_sgi.h"
104 #ifdef SOLARIS_THREADS
105 #include "thread_solaris.h"
109 #include "thread_lwp.h"
113 #include "thread_pth.h"
114 #undef _POSIX_THREADS
117 #ifdef _POSIX_THREADS
118 #include "thread_pthread.h"
122 #include "thread_cthread.h"
126 #include "thread_nt.h"
130 #include "thread_os2.h"
134 #include "thread_beos.h"
138 #include "thread_wince.h"
142 #ifdef FOOBAR_THREADS
143 #include "thread_foobar.h"