diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-12-09 21:34:53 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-12-09 21:34:53 +0000 |
commit | 293ee4d421cd55f4a3c014c1c26edf02f718cc83 (patch) | |
tree | ae4856e718b752ea0c6c807912bfbb51967fae80 /src/if_python.c | |
parent | 741b07e0092eb6d7b81c9cbe149196c6cf9d5bbe (diff) |
updated for version 7.0021v7.0021
Diffstat (limited to 'src/if_python.c')
-rw-r--r-- | src/if_python.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/if_python.c b/src/if_python.c index 8f4fdfd190..511378a0d3 100644 --- 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 |