Ignore:
Timestamp:
Oct 4, 2018, 11:48:51 PM (6 years ago)
Author:
alain
Message:

Complete restructuration of kernel locks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/devices/dev_nic.c

    r492 r565  
    9999    core_t * core = thread_ptr->core;
    100100
     101// check thread can yield
     102assert( (thread_ptr->busylocks == 0),
     103"cannot yield : busylocks = %d\n", thread_ptr->busylocks );
     104
    101105#if DEBUG_DEV_NIC_RX
    102106uint32_t cycle = (uint32_t)hal_get_cycles();
     
    133137        dev_pic_enable_irq( core->lid , dev_xp );
    134138
    135         // block on THREAD_BLOCKED_IO condition and deschedule
     139        // block client thread on THREAD_BLOCKED_IO
    136140        thread_block( XPTR( local_cxy , thread_ptr ) , THREAD_BLOCKED_IO );
     141
     142        // deschedule client thread
    137143        sched_yield("client blocked on I/O");
    138144
     
    176182    // get local pointer on core running this kernel thead
    177183    core_t * core = thread_ptr->core;
     184
     185// check thread can yield
     186assert( (thread_ptr->busylocks == 0),
     187"cannot yield : busylocks = %d\n", thread_ptr->busylocks );
    178188
    179189#if DEBUG_DEV_NIC_RX
     
    211221        dev_pic_enable_irq( core->lid ,dev_xp );
    212222
    213         // block on THREAD_BLOCKED I/O condition and deschedule
     223        // block client thread on THREAD_BLOCKED I/O condition
    214224        thread_block( XPTR( local_cxy , thread_ptr ) , THREAD_BLOCKED_IO );
     225
     226        // deschedule client thread
    215227        sched_yield("client blocked on I/O");
    216228
Note: See TracChangeset for help on using the changeset viewer.