Changeset 37c9fc8 in mainline for kernel/generic/src/proc/scheduler.c


Ignore:
Timestamp:
2010-04-25T10:15:35Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aa028db
Parents:
883fedc
Message:

Cherry pick revision 404 from lp:~ersin/helenos/measure2.
This fixes the case when the CPU lock was taken while interrupts were enabled.

File:
1 edited

Legend:

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

    r883fedc r37c9fc8  
    187187
    188188loop:
    189         interrupts_enable();
    190189       
    191190        if (atomic_get(&CPU->nrdy) == 0) {
     
    196195                 */
    197196
    198                 /*
     197                 /* Mark CPU as it was idle this clock tick */
     198                 spinlock_lock(&CPU->lock);
     199                 CPU->idle = true;
     200                 spinlock_unlock(&CPU->lock);
     201
     202                 interrupts_enable();
     203                 /*
    199204                 * An interrupt might occur right now and wake up a thread.
    200205                 * In such case, the CPU will continue to go to sleep
    201206                 * even though there is a runnable thread.
    202207                 */
    203 
    204                  spinlock_lock(&CPU->lock);
    205                  CPU->idle = true;
    206                  spinlock_unlock(&CPU->lock);
    207208                 cpu_sleep();
     209                 interrupts_disable();
    208210                 goto loop;
    209211        }
    210 
    211         interrupts_disable();
    212212       
    213213        for (i = 0; i < RQ_COUNT; i++) {
Note: See TracChangeset for help on using the changeset viewer.