Changeset 583c2a3 in mainline for kernel/generic/src/proc/scheduler.c


Ignore:
Timestamp:
2020-07-06T22:58:19Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
37d4c91, ee2f0beb
Parents:
762f989
Message:

Avoid most cases of direct used of list_t.prev/next in kernel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/scheduler.c

    r762f989 r583c2a3  
    610610
    611611                        /* Search rq from the back */
    612                         link_t *link = cpu->rq[rq].rq.head.prev;
    613 
    614                         while (link != &(cpu->rq[rq].rq.head)) {
     612                        link_t *link = list_last(&cpu->rq[rq].rq);
     613
     614                        while (link != NULL) {
    615615                                thread = (thread_t *) list_get_instance(link,
    616616                                    thread_t, rq_link);
     
    644644                                irq_spinlock_unlock(&thread->lock, false);
    645645
    646                                 link = link->prev;
     646                                link = list_prev(link, &cpu->rq[rq].rq);
    647647                                thread = NULL;
    648648                        }
Note: See TracChangeset for help on using the changeset viewer.