xiaoxiang781216 commented on code in PR #17222:
URL: https://github.com/apache/nuttx/pull/17222#discussion_r2462959019
##########
include/nuttx/sched.h:
##########
@@ -136,6 +136,10 @@
#define SPORADIC_FLAG_REPLENISH (1 << 2) /* Bit 2:
Replenishment cycle */
/* Bits 3-7:
Available */
+/* Map TSTATE_SLEEPING to TSTATE_WAIT_SIG for nxsched_sleep() compatibility */
+
+#define TSTATE_SLEEPING TSTATE_WAIT_SIG
Review Comment:
let's move to tstate_e
##########
sched/sched/sched_sleep.c:
##########
@@ -130,22 +99,72 @@ void nxsched_ticksleep(unsigned int ticks)
/* Add the task to the specified blocked task list */
- rtcb->task_state = TSTATE_WAIT_SIG;
+ rtcb->task_state = TSTATE_SLEEPING;
dq_addlast((FAR dq_entry_t *)rtcb, list_waitingforsignal());
/* Now, perform the context switch if one is needed */
up_switch_context(this_task(), rtcb);
- wd_cancel(&rtcb->waitdog);
+ /* Cancel the wdog only if wdog is still alive */
+
+ if (WDOG_ISACTIVE(&rtcb->waitdog))
Review Comment:
remove the check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]