Changeset e3f41b6 in mainline for src/proc/scheduler.c


Ignore:
Timestamp:
2005-06-06T20:01:57Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b0bf501
Parents:
d47f0e1
Message:

Code cleanup in scheduler.c thread.c - removed unnecessary spinlock.
atomic_inc, atomic_dec moved to arch/atomic.h instead of arch/smp/atomic.h,
advisable to use even in non-smp mode.
Fixed atomic_inc, atomic_dec in mips architecture.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/proc/scheduler.c

    rd47f0e1 re3f41b6  
    4343#include <synch/spinlock.h>
    4444#include <arch/faddr.h>
    45 
    46 #ifdef __SMP__
    47 #include <arch/smp/atomic.h>
    48 #endif /* __SMP__ */
     45#include <arch/atomic.h>
    4946
    5047/*
     
    5451 */
    5552
    56 spinlock_t nrdylock;
    5753volatile int nrdy;
    5854
     
    7874void scheduler_init(void)
    7975{
    80         spinlock_initialize(&nrdylock);
    8176}
    8277
     
    141136                }
    142137       
    143                 spinlock_lock(&nrdylock);
    144                 nrdy--;
    145                 spinlock_unlock(&nrdylock);             
     138                atomic_dec(&nrdy);
    146139
    147140                spinlock_lock(&CPU->lock);
     
    499492                                        spinlock_unlock(&cpu->lock);
    500493
    501                                         spinlock_lock(&nrdylock);
    502                                         nrdy--;
    503                                         spinlock_unlock(&nrdylock);                                     
     494                                        atomic_dec(&nrdy);
    504495
    505496                                        r->n--;
Note: See TracChangeset for help on using the changeset viewer.