Ensure that semaphore is destroyed even if it is held by the calling task.
This commit is contained in:
@@ -64,6 +64,10 @@ semBinaryDestroy(semBinaryId id)
|
||||
rtems_status_code sc;
|
||||
|
||||
sc = rtems_semaphore_delete (sid);
|
||||
if (sc == RTEMS_RESOURCE_IN_USE) {
|
||||
semBinaryGive (id);
|
||||
sc = rtems_semaphore_delete (sid);
|
||||
}
|
||||
if (sc != RTEMS_SUCCESSFUL)
|
||||
errlogPrintf ("Can't destroy semaphore: %s\n", rtems_status_text (sc));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user