Ensure that semaphore is destroyed even if it is held by the calling task.

This commit is contained in:
W. Eric Norum
2000-03-20 23:08:46 +00:00
parent e2c7b26c60
commit b35e62ed07

View File

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