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).
This commit is contained in:
Neal Norwitz 2006-10-28 21:37:42 +00:00
parent 7e3ec048f9
commit c975b9477b

View file

@ -667,6 +667,9 @@ test_thread_state(PyObject *self, PyObject *args)
PyThread_acquire_lock(thread_done, 1); /* wait for thread to finish */ PyThread_acquire_lock(thread_done, 1); /* wait for thread to finish */
Py_END_ALLOW_THREADS 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); PyThread_free_lock(thread_done);
Py_RETURN_NONE; Py_RETURN_NONE;
} }