Mercurial > cpython-lru_cache-weakref
comparison Python/pystate.c @ 37655:2f3f2e32dfd9 legacy-trunk
spread the extern "C" { } magic pixie dust around. Python itself builds now
using a C++ compiler. Still lots and lots of errors in the modules built by
setup.py, and a bunch of warnings from g++ in the core.
| author | Anthony Baxter <anthonybaxter@gmail.com> |
|---|---|
| date | Thu, 13 Apr 2006 02:06:09 +0000 |
| parents | f448d0075691 |
| children | 7f72791f0aec |
comparison
equal
deleted
inserted
replaced
| 37654:dec259e4d891 | 37655:2f3f2e32dfd9 |
|---|---|
| 34 #include "pythread.h" | 34 #include "pythread.h" |
| 35 static PyThread_type_lock head_mutex = NULL; /* Protects interp->tstate_head */ | 35 static PyThread_type_lock head_mutex = NULL; /* Protects interp->tstate_head */ |
| 36 #define HEAD_INIT() (void)(head_mutex || (head_mutex = PyThread_allocate_lock())) | 36 #define HEAD_INIT() (void)(head_mutex || (head_mutex = PyThread_allocate_lock())) |
| 37 #define HEAD_LOCK() PyThread_acquire_lock(head_mutex, WAIT_LOCK) | 37 #define HEAD_LOCK() PyThread_acquire_lock(head_mutex, WAIT_LOCK) |
| 38 #define HEAD_UNLOCK() PyThread_release_lock(head_mutex) | 38 #define HEAD_UNLOCK() PyThread_release_lock(head_mutex) |
| 39 | |
| 40 #ifdef __cplusplus | |
| 41 extern "C" { | |
| 42 #endif | |
| 39 | 43 |
| 40 /* The single PyInterpreterState used by this process' | 44 /* The single PyInterpreterState used by this process' |
| 41 GILState implementation | 45 GILState implementation |
| 42 */ | 46 */ |
| 43 static PyInterpreterState *autoInterpreterState = NULL; | 47 static PyInterpreterState *autoInterpreterState = NULL; |
| 550 } | 554 } |
| 551 /* Release the lock if necessary */ | 555 /* Release the lock if necessary */ |
| 552 else if (oldstate == PyGILState_UNLOCKED) | 556 else if (oldstate == PyGILState_UNLOCKED) |
| 553 PyEval_SaveThread(); | 557 PyEval_SaveThread(); |
| 554 } | 558 } |
| 559 | |
| 560 #ifdef __cplusplus | |
| 561 } | |
| 562 #endif | |
| 563 | |
| 555 #endif /* WITH_THREAD */ | 564 #endif /* WITH_THREAD */ |
| 565 | |
| 566 |
