From: Neal Norwitz Date: Sat, 28 Oct 2006 21:17:51 +0000 (+0000) Subject: Fix crash in test on HP-UX. Apparently, it's not possible to delete a lock if X-Git-Tag: v2.6a1~2504 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97a57220e8cfd857c7f46ec9d71f9f841c241fa8;p=python 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). Will backport. --- diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index edfe8adc67..b11f0aebfc 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; }