Mercurial > cpython-lru_cache-weakref
comparison Python/thread.c @ 4839:4567e158d20c legacy-trunk
Rename DEBUG macro to Py_DEBUG
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 30 Dec 1996 16:17:54 +0000 |
| parents | 4fa19659591e |
| children | 339d4129d3f7 |
comparison
equal
deleted
inserted
replaced
| 4838:5c1951d573b1 | 4839:4567e158d20c |
|---|---|
| 81 #define _P0() () | 81 #define _P0() () |
| 82 #define _P1(v,t) (v) t; | 82 #define _P1(v,t) (v) t; |
| 83 #define _P2(v1,t1,v2,t2) (v1,v2) t1; t2; | 83 #define _P2(v1,t1,v2,t2) (v1,v2) t1; t2; |
| 84 #endif /* __STDC__ */ | 84 #endif /* __STDC__ */ |
| 85 | 85 |
| 86 #ifdef DEBUG | 86 #ifdef Py_DEBUG |
| 87 static int thread_debug = 0; | 87 static int thread_debug = 0; |
| 88 #define dprintf(args) ((thread_debug & 1) && printf args) | 88 #define dprintf(args) ((thread_debug & 1) && printf args) |
| 89 #define d2printf(args) ((thread_debug & 8) && printf args) | 89 #define d2printf(args) ((thread_debug & 8) && printf args) |
| 90 #else | 90 #else |
| 91 #define dprintf(args) | 91 #define dprintf(args) |
| 96 | 96 |
| 97 static void _init_thread(); /* Forward */ | 97 static void _init_thread(); /* Forward */ |
| 98 | 98 |
| 99 void init_thread _P0() | 99 void init_thread _P0() |
| 100 { | 100 { |
| 101 #ifdef DEBUG | 101 #ifdef Py_DEBUG |
| 102 char *p = getenv("THREADDEBUG"); | 102 char *p = getenv("THREADDEBUG"); |
| 103 | 103 |
| 104 if (p) { | 104 if (p) { |
| 105 if (*p) | 105 if (*p) |
| 106 thread_debug = atoi(p); | 106 thread_debug = atoi(p); |
| 107 else | 107 else |
| 108 thread_debug = 1; | 108 thread_debug = 1; |
| 109 } | 109 } |
| 110 #endif /* DEBUG */ | 110 #endif /* Py_DEBUG */ |
| 111 if (initialized) | 111 if (initialized) |
| 112 return; | 112 return; |
| 113 initialized = 1; | 113 initialized = 1; |
| 114 dprintf(("init_thread called\n")); | 114 dprintf(("init_thread called\n")); |
| 115 _init_thread(); | 115 _init_thread(); |
