[Python-checkins] python/dist/src/Python ceval.c, 2.417,
2.418 pythonrun.c, 2.209, 2.210
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Mon Oct 11 04:40:54 CEST 2004
Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23529/Python
Modified Files:
ceval.c pythonrun.c
Log Message:
SF patch 1044089: New C API function PyEval_ThreadsInitialized(), by Nick
Coghlan, for determining whether PyEval_InitThreads() has been called.
Also purged the undocumented+unused _PyThread_Started int.
Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.417
retrieving revision 2.418
diff -u -d -r2.417 -r2.418
--- ceval.c 16 Sep 2004 16:41:57 -0000 2.417
+++ ceval.c 11 Oct 2004 02:40:50 -0000 2.418
@@ -203,17 +203,20 @@
#endif
#include "pythread.h"
-extern int _PyThread_Started; /* Flag for Py_Exit */
-
static PyThread_type_lock interpreter_lock = 0; /* This is the GIL */
static long main_thread = 0;
+int
+PyEval_ThreadsInitialized(void)
+{
+ return interpreter_lock != 0;
+}
+
void
PyEval_InitThreads(void)
{
if (interpreter_lock)
return;
- _PyThread_Started = 1;
interpreter_lock = PyThread_allocate_lock();
PyThread_acquire_lock(interpreter_lock, 1);
main_thread = PyThread_get_thread_ident();
Index: pythonrun.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v
retrieving revision 2.209
retrieving revision 2.210
diff -u -d -r2.209 -r2.210
--- pythonrun.c 7 Oct 2004 03:58:07 -0000 2.209
+++ pythonrun.c 11 Oct 2004 02:40:51 -0000 2.210
@@ -1517,7 +1517,6 @@
#ifdef WITH_THREAD
#include "pythread.h"
-int _PyThread_Started = 0; /* Set by threadmodule.c and maybe others */
#endif
#define NEXITFUNCS 32
More information about the Python-checkins
mailing list