Ignore:
Timestamp:
Aug 7, 2017, 12:50:17 PM (7 years ago)
Author:
alain
Message:

Introduce the delayed context switch if current thread has a lock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/scheduler.c

    r317 r337  
    283283    __FUNCTION__, current->trdid, local_cxy, core->lid, hal_time_stamp() );
    284284
    285     // check calling thread released all locks
    286     assert( (thread_can_yield() == true), __FUNCTION__, "locks not released\n");
     285    // delay the yield if current thread has locks
     286    if( thread_can_yield() == false )
     287    {
     288        current->flags |= THREAD_FLAG_SCHED;
     289        return;
     290    }
    287291
    288292    // first loop on all threads to handle pending signals
     
    325329        // restore IRQs when calling thread resume
    326330        hal_restore_irq( sr_save );
    327 
    328         sched_dmsg("\n[INFO] %s : thread %x on core[%x,%d] / cycle %d\n",
    329         __FUNCTION__, current->trdid, local_cxy, core->lid, hal_time_stamp() );
    330331    }
    331332    else
Note: See TracChangeset for help on using the changeset viewer.