mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
Tickless OS: Correct a bug: logic to detect changes in head of timer list was wrong.
This commit is contained in:
+11
-10
@@ -292,9 +292,9 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...)
|
|||||||
|
|
||||||
if (g_wdactivelist.head == NULL)
|
if (g_wdactivelist.head == NULL)
|
||||||
{
|
{
|
||||||
/* Add the watchdog to the head of the queue. */
|
/* Add the watchdog to the head == tail of the queue. */
|
||||||
|
|
||||||
sq_addlast((FAR sq_entry_t*)wdog,&g_wdactivelist);
|
sq_addlast((FAR sq_entry_t*)wdog, &g_wdactivelist);
|
||||||
|
|
||||||
#ifdef CONFIG_SCHED_TICKLESS
|
#ifdef CONFIG_SCHED_TICKLESS
|
||||||
/* Whenever the watchdog at the head of the queue changes, then we
|
/* Whenever the watchdog at the head of the queue changes, then we
|
||||||
@@ -345,16 +345,9 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...)
|
|||||||
|
|
||||||
if (curr == (FAR wdog_t*)g_wdactivelist.head)
|
if (curr == (FAR wdog_t*)g_wdactivelist.head)
|
||||||
{
|
{
|
||||||
/* Insert the watchdog in mid- or end-of-queue */
|
/* Insert the watchdog at the head of the list */
|
||||||
|
|
||||||
sq_addfirst((FAR sq_entry_t*)wdog, &g_wdactivelist);
|
sq_addfirst((FAR sq_entry_t*)wdog, &g_wdactivelist);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Insert the watchdog in mid- or end-of-queue */
|
|
||||||
|
|
||||||
sq_addafter((FAR sq_entry_t*)prev, (FAR sq_entry_t*)wdog,
|
|
||||||
&g_wdactivelist);
|
|
||||||
|
|
||||||
#ifdef CONFIG_SCHED_TICKLESS
|
#ifdef CONFIG_SCHED_TICKLESS
|
||||||
/* If the watchdog at the head of the queue changes, then we
|
/* If the watchdog at the head of the queue changes, then we
|
||||||
@@ -363,6 +356,14 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...)
|
|||||||
|
|
||||||
reassess = true;
|
reassess = true;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Insert the watchdog in mid- or end-of-queue */
|
||||||
|
|
||||||
|
sq_addafter((FAR sq_entry_t*)prev, (FAR sq_entry_t*)wdog,
|
||||||
|
&g_wdactivelist);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user