From: Neal Norwitz Date: Sat, 28 Oct 2006 21:37:42 +0000 (+0000) Subject: Backport 52503: X-Git-Tag: v2.5.1c1~287 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c975b9477b8181db2f9076be43f53ef32397319b;p=thirdparty%2FPython%2Fcpython.git Backport 52503: Fix crash in test on HP-UX. Apparently, it's not possible to delete a lock if it's held (even by the current thread). --- diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index edfe8adc6764..b11f0aebfc11 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -667,6 +667,9 @@ test_thread_state(PyObject *self, PyObject *args) PyThread_acquire_lock(thread_done, 1); /* wait for thread to finish */ Py_END_ALLOW_THREADS + /* Release lock we acquired above. This is required on HP-UX. */ + PyThread_release_lock(thread_done); + PyThread_free_lock(thread_done); Py_RETURN_NONE; }