Changeset dfa4be62 in mainline for kernel/generic/src/proc/thread.c


Ignore:
Timestamp:
2024-01-21T16:23:19Z (14 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master
Children:
d23712e
Parents:
a3d87b9
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-03-28 17:40:43)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2024-01-21 16:23:19)
Message:

Thread lock is no longer necessary

File:
1 edited

Legend:

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

    ra3d87b9 rdfa4be62  
    115115        thread_t *thread = (thread_t *) obj;
    116116
    117         irq_spinlock_initialize(&thread->lock, "thread_t_lock");
    118117        link_initialize(&thread->rq_link);
    119118        link_initialize(&thread->wq_link);
     
    197196void thread_wire(thread_t *thread, cpu_t *cpu)
    198197{
    199         irq_spinlock_lock(&thread->lock, true);
     198        ipl_t ipl = interrupts_disable();
    200199        atomic_set_unordered(&thread->cpu, cpu);
    201200        thread->nomigrate++;
    202         irq_spinlock_unlock(&thread->lock, true);
     201        interrupts_restore(ipl);
    203202}
    204203
     
    579578void thread_migration_disable(void)
    580579{
     580        ipl_t ipl = interrupts_disable();
     581
    581582        assert(THREAD);
    582 
    583583        THREAD->nomigrate++;
     584
     585        interrupts_restore(ipl);
    584586}
    585587
     
    587589void thread_migration_enable(void)
    588590{
     591        ipl_t ipl = interrupts_disable();
     592
    589593        assert(THREAD);
    590594        assert(THREAD->nomigrate > 0);
     
    592596        if (THREAD->nomigrate > 0)
    593597                THREAD->nomigrate--;
     598
     599        interrupts_restore(ipl);
    594600}
    595601
Note: See TracChangeset for help on using the changeset viewer.