diff options
author | Michael W. Hudson <mwh@python.net> | 2005-04-18 08:46:17 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2005-04-18 08:46:17 (GMT) |
commit | 774479c68bf6953e89996c24287199d3f3331ba3 (patch) | |
tree | 064874935cc0f155b9f9acf6fca76de0e3177a04 | |
parent | 6d22b56b7e92815bac598ecda645bfd15d6dd6b8 (diff) | |
download | cpython-774479c68bf6953e89996c24287199d3f3331ba3.zip cpython-774479c68bf6953e89996c24287199d3f3331ba3.tar.gz cpython-774479c68bf6953e89996c24287199d3f3331ba3.tar.bz2 |
Fix:
[ 1176893 ] Readline segfault
by unsilly-ing PyGILState_Release().
Backport candidate.
-rw-r--r-- | Misc/NEWS | 6 | ||||
-rw-r--r-- | Python/pystate.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -12,6 +12,12 @@ What's New in Python 2.5 alpha 1? Core and builtins ----------------- +- It is now safe to call PyGILState_Release() before + PyEval_InitThreads() (note that if there is reason to believe there + are multiple threads around you still must call PyEval_InitThreads() + before using the Python API; this fix is for extension modules that + have no way of knowing if Python is multi-threaded yet). + - Typing Ctrl-C whilst raw_input() was waiting in a build with threads disabled caused a crash. diff --git a/Python/pystate.c b/Python/pystate.c index 255cf7e..abca8dd 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -503,6 +503,6 @@ PyGILState_Release(PyGILState_STATE oldstate) } /* Release the lock if necessary */ else if (oldstate == PyGILState_UNLOCKED) - PyEval_ReleaseThread(tcur); + PyEval_SaveThread(); } #endif /* WITH_THREAD */ |