System assert in __fwk_slist_is_empty
Created by: pengluyou
Hi: In single thread environment, we add a device triggered by interrupt, and in the ISR it will send out notification. When interrupt come in with a high frequency some times system assert in __fwk_slist_is_empty, because just after check list is empty then an interrupt generated it will put a node to the list so this assert be triggered. if (is_empty) assert(list->tail == list->head); Can we modify this function as below? or use an interrupt disable/enable to protect this empty check? bool __fwk_slist_is_empty(const struct fwk_slist *list) { bool is_empty;
assert(list != NULL);
is_empty = false;
if(list->head == (struct fwk_slist_node *)list)
{
is_empty = (list->tail == list->head);
}
return is_empty;
}