Ignore:
Timestamp:
Aug 7, 2017, 12:50:17 PM (7 years ago)
Author:
alain
Message:

Introduce the delayed context switch if current thread has a lock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/spinlock.c

    r331 r337  
    8484    list_unlink( &lock->list );
    8585
    86     hal_restore_irq( irq_state );
     86    // deschedule if pending request
     87    thread_check_sched();
     88 
     89    // restore IRQs
     90        hal_restore_irq( irq_state );
    8791}
    8892
     
    120124    list_add_first( &this->locks_root , &lock->list );
    121125
    122     // enable interrupts
     126    // restore IRQs
    123127    hal_restore_irq( mode );
    124128}
     
    160164    this->local_locks--;
    161165    list_unlink( &lock->list );
     166
     167    // deschedule if pending request
     168    thread_check_sched();
    162169}
    163170
Note: See TracChangeset for help on using the changeset viewer.