[Python-checkins] cpython: Fix compilation of _testembed.c without threads

victor.stinner python-checkins at python.org
Tue Apr 26 23:51:16 CEST 2011


http://hg.python.org/cpython/rev/79fcd71d0356
changeset: 69585:79fcd71d0356
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Tue Apr 26 23:37:02 2011 +0200
summary:
 Fix compilation of _testembed.c without threads
files:
 Modules/_testembed.c | 6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Modules/_testembed.c b/Modules/_testembed.c
--- a/Modules/_testembed.c
+++ b/Modules/_testembed.c
@@ -17,7 +17,9 @@
 int main(int argc, char *argv[])
 {
 PyThreadState *mainstate, *substate;
+#ifdef WITH_THREAD
 PyGILState_STATE gilstate;
+#endif
 int i, j;
 
 for (i=0; i<3; i++) {
@@ -28,10 +30,12 @@
 Py_Initialize();
 mainstate = PyThreadState_Get();
 
+#ifdef WITH_THREAD
 PyEval_InitThreads();
 PyEval_ReleaseThread(mainstate);
 
 gilstate = PyGILState_Ensure();
+#endif
 print_subinterp();
 PyThreadState_Swap(NULL);
 
@@ -43,7 +47,9 @@
 
 PyThreadState_Swap(mainstate);
 print_subinterp();
+#ifdef WITH_THREAD
 PyGILState_Release(gilstate);
+#endif
 
 PyEval_RestoreThread(mainstate);
 Py_Finalize();
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /