@@ -39,7 +39,7 @@ sched_enqueue(struct sched *sched, struct exec_context *ctx)
3939{
4040 xlog_trace ("%s: enqueueing ctx %p" , __func__ , (void * )ctx );
4141 assert (sched == ctx -> sched );
42- LIST_INSERT_TAIL (& sched -> runq , ctx , rq );
42+ SLIST_INSERT_TAIL (& sched -> runq , ctx , rq );
4343}
4444
4545#define RR_INTERVAL_MS 100
@@ -50,9 +50,9 @@ sched_run(struct sched *sched, struct exec_context *caller)
5050 struct runq * q = & sched -> runq ;
5151 struct exec_context * ctx ;
5252
53- while ((ctx = LIST_FIRST (q )) != NULL ) {
53+ while ((ctx = SLIST_FIRST (q )) != NULL ) {
5454 int ret ;
55- LIST_REMOVE (q , ctx , rq );
55+ SLIST_REMOVE_HEAD (q , ctx , rq );
5656 xlog_trace ("%s: running ctx %p" , __func__ , (void * )ctx );
5757 ret = abstime_from_reltime_ms (
5858 CLOCK_MONOTONIC , & sched -> next_resched , RR_INTERVAL_MS );
@@ -71,7 +71,7 @@ sched_run(struct sched *sched, struct exec_context *caller)
7171 if (IS_RESTARTABLE (ret ) && ret != ETOYWASMUSERINTERRUPT ) {
7272 xlog_trace ("%s: re-enqueueing ctx %p" , __func__ ,
7373 (void * )ctx );
74- LIST_INSERT_TAIL (q , ctx , rq );
74+ SLIST_INSERT_TAIL (q , ctx , rq );
7575 continue ;
7676 }
7777 xlog_trace ("%s: finishing ctx %p" , __func__ , (void * )ctx );
@@ -87,7 +87,7 @@ sched_run(struct sched *sched, struct exec_context *caller)
8787void
8888sched_init (struct sched * sched )
8989{
90- LIST_HEAD_INIT (& sched -> runq );
90+ SLIST_HEAD_INIT (& sched -> runq );
9191}
9292
9393void
@@ -102,7 +102,7 @@ sched_need_resched(struct sched *sched)
102102 int ret ;
103103
104104 /* if we are the only thread, no point to resched. */
105- if (LIST_FIRST (& sched -> runq ) == NULL ) {
105+ if (SLIST_FIRST (& sched -> runq ) == NULL ) {
106106 return false;
107107 }
108108
0 commit comments