Changeset 117ad5a2 in mainline


Ignore:
Timestamp:
2023-04-19T09:31:02Z (18 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ec8ef12
Parents:
f3dbe27
Message:

Get thread priority from find_best_thread(), instead of locking thread again

File:
1 edited

Legend:

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

    rf3dbe27 r117ad5a2  
    178178 *
    179179 */
    180 static thread_t *find_best_thread(void)
     180static thread_t *find_best_thread(int *rq_index)
    181181{
    182182        assert(CPU != NULL);
     
    245245                irq_spinlock_unlock(&thread->lock, false);
    246246
     247                *rq_index = i;
    247248                return thread;
    248249        }
     
    462463        }
    463464
    464         THREAD = find_best_thread();
    465 
    466         irq_spinlock_lock(&THREAD->lock, false);
    467         int priority = THREAD->priority;
    468         irq_spinlock_unlock(&THREAD->lock, false);
    469 
    470         relink_rq(priority);
     465        int rq_index;
     466        THREAD = find_best_thread(&rq_index);
     467
     468        relink_rq(rq_index);
    471469
    472470        switch_task(THREAD->task);
Note: See TracChangeset for help on using the changeset viewer.