diff src/if_python.c @ 36:125e80798a85 v7.0021

updated for version 7.0021
author vimboss
date Thu, 09 Dec 2004 21:34:53 +0000
parents 4ac1dce8dd5e
children b5fc81a825a1
line wrap: on
line diff
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -381,13 +381,14 @@ typedef PyObject PyThreadState;
 #endif /* Python 1.4 */
 
 #ifndef PY_CAN_RECURSE
-static PyThreadState* saved_python_thread = NULL;
+static PyThreadState *saved_python_thread = NULL;
 
 /*
  * Suspend a thread of the Python interpreter, other threads are allowed to
  * run.
  */
-static void Python_SaveThread(void)
+    static void
+Python_SaveThread(void)
 {
     saved_python_thread = PyEval_SaveThread();
 }
@@ -396,7 +397,8 @@ static void Python_SaveThread(void)
  * Restore a thread of the Python interpreter, waits for other threads to
  * block.
  */
-static void Python_RestoreThread(void)
+    static void
+Python_RestoreThread(void)
 {
     PyEval_RestoreThread(saved_python_thread);
     saved_python_thread = NULL;
@@ -456,8 +458,10 @@ Python_Init(void)
 	if (PythonMod_Init())
 	    goto fail;
 
-#ifndef PY_CAN_RECURSE
-	/* the first python thread is vim's */
+	/* the first python thread is vim's, release the lock */
+#ifdef PY_CAN_RECURSE
+	PyEval_SaveThread();
+#else
 	Python_SaveThread();
 #endif