kernel/binary_manager_load : Add Debug message for checking g_sem_list
If g_sem_list is empty, it means there is no kernel semaphore which used by threads.
For checking this, added the debug message.
@@ -547,7 +547,10 @@ void binary_manager_release_binary_sem(int bin_idx)
flags = irqsave();
sem = (sem_t *)sq_peek(&g_sem_list);
- while (sem) {
+ if (sem == NULL) {
+ bmdbg("g_sem_list is empty.\n");
+ } else {
+ do {
#if CONFIG_SEM_PREALLOCHOLDERS > 0
for (holder = sem->hhead; holder; holder = holder->flink)
#else
@@ -563,6 +566,7 @@ void binary_manager_release_binary_sem(int bin_idx)
}
}
sem = sq_next(sem);
+ } while (sem);
}
irqrestore(flags);
}
