Changeset 296 for trunk/kernel/syscalls


Ignore:
Timestamp:
Jul 31, 2017, 1:59:52 PM (7 years ago)
Author:
alain
Message:

Several modifs in the generic scheduler and in the hal_context to
fix the context switch mechanism.

Location:
trunk/kernel/syscalls
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_thread_exit.c

    r60 r296  
    7474
    7575                // deschedule
    76                 sched_yield();
     76                sched_yield( NULL );
    7777            }     
    7878        }
  • trunk/kernel/syscalls/sys_thread_join.c

    r23 r296  
    138138
    139139            // deschedule
    140             sched_yield();
     140            sched_yield( NULL );
    141141        }
    142142    }
  • trunk/kernel/syscalls/sys_thread_sleep.c

    r101 r296  
    3030int sys_thread_sleep()
    3131{
     32    thread_t * this = CURRENT_THREAD;
     33
    3234    thread_dmsg("\n[INFO] %s : thread %x in process %x goes to sleep at cycle %d\n",
    33                 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_PROCESS->pid, hal_get_cycles() );
     35                __FUNCTION__, this->trdid, this->process->pid, hal_get_cycles() );
    3436
    35     thread_block( CURRENT_THREAD , THREAD_BLOCKED_GLOBAL );
    36     sched_yield();
     37    thread_block( this , THREAD_BLOCKED_GLOBAL );
     38    sched_yield( NULL );
    3739
    3840    thread_dmsg("\n[INFO] %s : thread %x in process %x resume at cycle\n",
    39                 __FUNCTION__, CURRENT_THREAD->trdid, CURRENT_PROCESS->pid, hal_get_cycles() );
     41                __FUNCTION__, this->trdid, this->process->pid, hal_get_cycles() );
    4042
    4143        return 0;
  • trunk/kernel/syscalls/sys_thread_yield.c

    r23 r296  
    2727int sys_thread_yield()
    2828{
    29         sched_yield();
     29        sched_yield( NULL );
    3030        return 0;
    3131}
Note: See TracChangeset for help on using the changeset viewer.