Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf4a8e9

Browse files
committed
py/scheduler: Break out of the c task loop on re-schedule.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1 parent2a6bb79 commitaf4a8e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎py/scheduler.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,14 @@ static inline void mp_sched_run_pending(void) {
8888

8989
#ifMICROPY_SCHEDULER_STATIC_NODES
9090
// Run all pending C callbacks.
91-
while (MP_STATE_VM(sched_head)!=NULL) {
91+
boolpass_finished= false;
92+
while (MP_STATE_VM(sched_head)!=NULL&& !pass_finished) {
9293
mp_sched_node_t*node=MP_STATE_VM(sched_head);
9394
MP_STATE_VM(sched_head)=node->next;
9495
if (MP_STATE_VM(sched_head)==NULL) {
9596
MP_STATE_VM(sched_tail)=NULL;
97+
// ensure we exit even if a task re-scheduled in callback() below.
98+
pass_finished= true;
9699
}
97100
mp_sched_callback_tcallback=node->callback;
98101
node->callback=NULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp