summaryrefslogtreecommitdiff
path: root/src/idle.c
diff options
context:
space:
mode:
authorMeco Jianting Man <[email protected]>2021-06-05 13:03:45 +0800
committerGitHub <[email protected]>2021-06-05 13:03:45 +0800
commitbfd8d21e388befc5d971075db5af0ed561abb4f2 (patch)
treed5caabadeb30fc67b3e0efa6dad251617639e096 /src/idle.c
parent02331fd30d1f1ca8c886aac4db6c8c111987913c (diff)
parent28847008171ab7423b6b05b7157d3467f1525fda (diff)
Merge branch 'master' into mutexrevert
Diffstat (limited to 'src/idle.c')
-rw-r--r--src/idle.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/idle.c b/src/idle.c
index 24dfffbc6d..e73a78be9c 100644
--- a/src/idle.c
+++ b/src/idle.c
@@ -127,6 +127,7 @@ rt_err_t rt_thread_idle_delhook(void (*hook)(void))
#endif
+#ifdef RT_USING_HEAP
/* Return whether there is defunctional thread to be deleted. */
rt_inline int _has_defunct_thread(void)
{
@@ -140,6 +141,7 @@ rt_inline int _has_defunct_thread(void)
return l->next != l;
}
+#endif
/**
* @ingroup Thread
@@ -200,12 +202,14 @@ static void rt_thread_idle_entry(void *parameter)
{
#ifdef RT_USING_IDLE_HOOK
rt_size_t i;
+ void (*idle_hook)(void);
for (i = 0; i < RT_IDLE_HOOK_LIST_SIZE; i++)
{
- if (idle_hook_list[i] != RT_NULL)
+ idle_hook = idle_hook_list[i];
+ if (idle_hook != RT_NULL)
{
- idle_hook_list[i]();
+ idle_hook();
}
}
#endif