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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.