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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user