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.
This commit is contained in:
Neal Norwitz 2006-10-28 21:17:51 +00:00
parent a5ccda95f2
commit 97a57220e8
1 changed files with 3 additions and 0 deletions

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;
} }