sched/semaphore: Convert strange use of DEBUGASSERT to DEBUGPANIC.

This commit is contained in:
Gregory Nutt 2017-03-21 13:34:17 -06:00
parent 248c821730
commit e8e3c2f362

View file

@ -338,7 +338,7 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder,
if (!sched_verifytcb(htcb))
{
serr("ERROR: TCB 0x%08x is a stale handle, counts lost\n", htcb);
DEBUGASSERT(sched_verifytcb(htcb));
DEBUGPANIC();
sem_freeholder(sem, pholder);
}
@ -498,7 +498,7 @@ static int sem_restoreholderprio(FAR struct tcb_s *htcb,
if (!sched_verifytcb(htcb))
{
serr("ERROR: TCB 0x%08x is a stale handle, counts lost\n", htcb);
DEBUGASSERT(sched_verifytcb(htcb));
DEBUGPANIC();
pholder = sem_findholder(sem, htcb);
if (pholder != NULL)
{
@ -905,14 +905,14 @@ void sem_destroyholder(FAR sem_t *sem)
if (sem->hhead != NULL)
{
serr("ERROR: Semaphore destroyed with holders\n");
DEBUGASSERT(sem->hhead == NULL);
DEBUGPANIC();
(void)sem_foreachholder(sem, sem_recoverholders, NULL);
}
#else
if (sem->holder[0].htcb != NULL || sem->holder[1].htcb != NULL)
{
DEBUGASSERT(sem->holder[0].htcb == NULL || sem->holder[1].htcb == NULL);
serr("ERROR: Semaphore destroyed with holder\n");
DEBUGPANIC();
}
sem->holder[0].htcb = NULL;