Ignore:
Timestamp:
Jun 29, 2018, 10:44:14 AM (6 years ago)
Author:
alain
Message:

Fix a bug in function sched_handle_signal():
When the deleted user thread is the last executed thread,
the sched->u_last field must be updated to point on another user thread.

File:
1 edited

Legend:

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

    r446 r450  
    654654if( DEBUG_THREAD_DESTROY < cycle )
    655655printk("\n[DBG] %s : thread %x enter to destroy thread %x in process %x / cycle %d\n",
    656 __FUNCTION__, CURRENT_THREAD, thread, process->pid, cycle );
     656__FUNCTION__, CURRENT_THREAD, thread->trdid, process->pid, cycle );
    657657#endif
    658658
     
    694694cycle = (uint32_t)hal_get_cycles();
    695695if( DEBUG_THREAD_DESTROY < cycle )
    696 printk("\n[DBG] %s : thread %x exit / destroyed thread %x in process %x / cycle %d\n",
    697 __FUNCTION__, CURRENT_THREAD, thread, process->pid, cycle );
     696printk("\n[DBG] %s : thread %x exit / destroyed thread %x in process %x / last %d / cycle %d\n",
     697__FUNCTION__, CURRENT_THREAD, thread->trdid, process->pid, last_thread / cycle );
    698698#endif
    699699
     
    800800uint32_t cycle = (uint32_t)hal_get_cycles();
    801801if( DEBUG_THREAD_BLOCK < cycle )
    802 printk("\n[@@@] %s : thread %x  in cxy %x blocked thread %x in cxy %x / cause %x / cycle %d\n",
     802printk("\n[DBG] %s : thread %x  in cxy %x blocked thread %x in cxy %x / cause %x / cycle %d\n",
    803803__FUNCTION__ , CURRENT_THREAD , local_cxy , ptr , cxy , cause , cycle );
    804 #endif
    805 
    806 #if (DEBUG_THREAD_BLOCK & 1)
    807 if( DEBUG_THREAD_BLOCK < cycle )
    808 {
    809     if( cxy == local_cxy)
    810     {
    811         sched_display( ptr->core->lid );
    812     }
    813     else
    814     {
    815         core_t * core = hal_remote_lpt( XPTR( cxy , &ptr->core ) );
    816         lid_t    lid  = hal_remote_lw ( XPTR( cxy , &core->lid ) );
    817         rpc_sched_display_client( cxy , lid );
    818     }
    819 }
    820804#endif
    821805
     
    837821uint32_t cycle = (uint32_t)hal_get_cycles();
    838822if( DEBUG_THREAD_BLOCK < cycle )
    839 printk("\n[@@@] %s : thread %x  in cxy %x unblocked thread %x in cxy %x / cause %x / cycle %d\n",
     823printk("\n[DBG] %s : thread %x  in cxy %x unblocked thread %x in cxy %x / cause %x / cycle %d\n",
    840824__FUNCTION__ , CURRENT_THREAD , local_cxy , ptr , cxy , cause , cycle );
    841 #endif
    842 
    843 #if (DEBUG_THREAD_BLOCK & 1)
    844 if( DEBUG_THREAD_BLOCK < cycle )
    845 {
    846     if( cxy == local_cxy)
    847     {
    848         sched_display( ptr->core->lid );
    849     }
    850     else
    851     {
    852         core_t * core = hal_remote_lpt( XPTR( cxy , &ptr->core ) );
    853         lid_t    lid  = hal_remote_lw ( XPTR( cxy , &core->lid ) );
    854         rpc_sched_display_client( cxy , lid );
    855     }
    856 }
    857825#endif
    858826
Note: See TracChangeset for help on using the changeset viewer.