Ignore:
Timestamp:
May 29, 2018, 9:27:23 AM (6 years ago)
Author:
alain
Message:

Restructure the mini_libc.

File:
1 edited

Legend:

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

    r443 r445  
    401401uint32_t cycle = (uint32_t)hal_get_cycles();
    402402if( DEBUG_PROCESS_DESTROY )
    403 printk("\n[DBG] %s : thread %x enter in cluster %x / pid %x / process %x / cycle %d\n",
    404 __FUNCTION__ , CURRENT_THREAD , pid , process , cycle );
     403printk("\n[DBG] %s : thread %x enter for process %x in cluster %x / cycle %d\n",
     404__FUNCTION__ , CURRENT_THREAD , pid , local_cxy , cycle );
    405405#endif
    406406
     
    447447cycle = (uint32_t)hal_get_cycles();
    448448if( DEBUG_PROCESS_DESTROY )
    449 printk("\n[DBG] %s : thread %x exit / destroyed process %x (pid = %x) / cycle %d\n",
    450 __FUNCTION__ , CURRENT_THREAD , process, pid, cycle );
     449printk("\n[DBG] %s : thread %x exit / destroyed process %x in cluster %x / cycle %d\n",
     450__FUNCTION__ , CURRENT_THREAD , pid, local_cxy, cycle );
    451451#endif
    452452
     
    13791379    process_txt_detach( XPTR( local_cxy , old_process ) );
    13801380
    1381     // request old_thread destruction => old_process destruction
     1381    // block this old_thread
    13821382    thread_block( XPTR( local_cxy , old_thread ) , THREAD_BLOCKED_GLOBAL );
    1383     hal_atomic_or( &old_thread->flags , THREAD_FLAG_REQ_DELETE );
     1383
     1384    // atomically update old_process descriptor term_state to ask
     1385    // the parent process (wait() function) to delete this old_thread
     1386    hal_atomic_or( &old_process->term_state , PROCESS_TERM_EXIT );
    13841387
    13851388    hal_fence();
Note: See TracChangeset for help on using the changeset viewer.