Try harder to destroy mutex semaphores. If an attempt to destroy one

fails because it is locked, try again after unlocking it.  This won't
work if the thread has recursively locked the mutex, but it seems to
be fine for all the cases the EPICS uses.
This commit is contained in:
W. Eric Norum
2000-04-07 17:21:39 +00:00
parent d387eedb35
commit 2378bce7f6
+10 -1
View File
@@ -216,7 +216,16 @@ semMutexId semMutexMustCreate(void)
void semMutexDestroy(semMutexId id)
{
semBinaryDestroy (id);
rtems_id sid = (rtems_id)id;
rtems_status_code sc;
sc = rtems_semaphore_delete (sid);
if (sc == RTEMS_RESOURCE_IN_USE) {
rtems_semaphore_release (sid);
sc = rtems_semaphore_delete (sid);
}
if (sc != RTEMS_SUCCESSFUL)
errlogPrintf ("Can't destroy semaphore: %s\n", rtems_status_text (sc));
}
void semMutexGive(semMutexId id)