Ignore:
Timestamp:
May 16, 2018, 4:15:22 PM (7 years ago)
Author:
alain
Message:

Fix few bugs whike debugging the sort multi-thread application.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_wait.c

    r440 r443  
    7373        }
    7474
    75     // get process owner cluster and calling thread trdid
     75    // get calling process owner cluster
    7676    cxy_t   owner_cxy = CXY_FROM_PID( pid );
    77     trdid_t trdid     = this->trdid;
    7877
    79     // wait must be executed by the main thread
     78    // get calling thread trdid
     79    trdid_t trdid = this->trdid;
     80
     81    // this function must be executed by the process main thread
    8082    if( (owner_cxy != local_cxy) || (LTID_FROM_TRDID(trdid) != 0) )
    8183    {
     
    113115            child_state = (int)hal_remote_lw ( XPTR(child_cxy,&child_ptr->term_state));
    114116
    115             // test if child process is terminated,
     117            // test if this child process is terminated,
    116118            // but termination not yet reported to parent process
    117119            if( ((child_state & PROCESS_TERM_EXIT)  ||
     
    120122                 ((child_state & PROCESS_TERM_WAIT) == 0) )
    121123            {
    122                 // get pointer on main thread and PID from child owner process
     124                // get pointer on child main thread and PID from child owner process
    123125                child_pid    = (pid_t)     hal_remote_lw (XPTR( child_cxy , &child_ptr->pid ));
    124126                child_thread = (thread_t *)hal_remote_lpt(XPTR( child_cxy ,
    125127                                                                &child_ptr->th_tbl[0] ));
    126128
    127                 // set the PROCESS_FLAG_WAIT in owner child descriptor
     129                // set the PROCESS_FLAG_WAIT in owner child process descriptor
    128130                hal_remote_atomic_or( XPTR( child_cxy , &child_ptr->term_state ),
    129131                                      PROCESS_TERM_WAIT );
Note: See TracChangeset for help on using the changeset viewer.