LJ Archive

Listing 3. New sched-yield Code

asmlinkage int sys_sched_yield(void) {
 cli();
move_last_runqueue(current);
if (current->counter) // CHANGE IS HERE
 current->counter--;
 need_resched = 1;
 sti();
 return 0;
 }
LJ Archive