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

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

File:
1 edited

Legend:

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

    r441 r443  
    9090 * The process descriptor is replicated in all clusters containing at least one thread
    9191 * of the PID process, with the following rules :
    92  * 1) The <pid>, <ppid>, <ref_xp>, <vfs_root_xp>, <vfs_bin_xp>  fields are defined
    93  *    in all process descriptor copies.
     92 * 1) The <pid>, <ppid>, <ref_xp>, <owner_xp>, <vfs_root_xp>, <vfs_bin_xp>  fields are
     93 *    defined in all process descriptor copies.
    9494 * 2) The <vfs_cwd_xp> and associated <cwd_lock>, that can be dynamically modified,
    9595 *    are only defined in the reference process descriptor.
     
    106106 *    are defined in all process descriptors copies.
    107107 * 7) The termination <flags> and <exit_status> are only defined in the reference cluster.
    108  *    The term state format is defined in the shared_syscalls.h file.
     108 *    The term_state format is defined in the shared_syscalls.h file.
    109109 ********************************************************************************************/
    110110
     
    119119        pid_t             pid;              /*! process identifier                              */
    120120    xptr_t            ref_xp;           /*! extended pointer on reference process           */
     121    xptr_t            owner_xp;         /*! extended pointer on owner process               */
    121122    xptr_t            parent_xp;        /*! extended pointer on parent process              */
    122123
     
    264265/*********************************************************************************************
    265266 * This debug function diplays on the kernel terminal TXT0 detailed informations on a
    266  * reference process identified by the <process_xp> argument.
     267 * process descriptor identified by the <process_xp> argument.
    267268 * It can be called by a thread running in any cluster.
    268  *********************************************************************************************
    269  * @ process_xp : extended pointer on reference process.
     269 * WARNING: this function uses the nolock_printk() function, and the  TXT0 lock MUST be
     270 * taken by the caller function.
     271 *********************************************************************************************
     272 * @ process_xp : extended pointer on process descriptor.
    270273 ********************************************************************************************/
    271274void process_display( xptr_t process_xp );
     
    379382
    380383/*********************************************************************************************
    381  * This function implements the "fork" system call, and is called by the sys_fork() function.
    382  * It allocates memory and initializes a new "child" process descriptor, and the
    383  * associated "child" thread descriptor in the local cluster. This function can involve
    384  * up to three different clusters :
    385  * - the child (local) cluster can be any cluster defined by the sys_fork function.
     384 * This function implements the "fork" system call, and is called by the sys_fork() function,
     385 * likely throuch the RPC_PROCESS_MAKE_FORK.
     386 * It allocates memory and initializes a new "child" process descriptor, and the associated
     387 * "child" thread descriptor in local cluster. It involves up to three different clusters :
     388 * - the child (local) cluster can be any cluster selected by the sys_fork function.
    386389 * - the parent cluster must be the reference cluster for the parent process.
    387390 * - the client cluster containing the thread requesting the fork can be any cluster.
     
    483486 * It checks that there is an available slot in the local th_tbl[] array,
    484487 * allocates a new LTID, and registers the new thread in the th_tbl[].
    485  * WARNING : the lock protecting the th_tbl[] must be taken by the caller.
     488 * It takes the lock protecting exclusive access to the th_tbl[].
    486489 *********************************************************************************************
    487490 * @ process  : pointer on the local process descriptor.
     
    496499/*********************************************************************************************
    497500 * This function removes a thread registration from the local process descriptor.
    498  * WARNING : the lock protecting the th_tbl[] must be taken by the caller.
     501 * It takes the lock protecting exclusive access to the th_tbl[].
    499502 *********************************************************************************************
    500503 * @ thread   : local pointer on thread to be removed.
    501  ********************************************************************************************/
    502 void process_remove_thread( struct thread_s * thread );
     504 * @ return true if the removed thread was the last registered thread.
     505 ********************************************************************************************/
     506bool_t process_remove_thread( struct thread_s * thread );
    503507
    504508
     
    551555 * When the process dentified by the <owner_xp> argument has the exclusive ownership of
    552556 * the TXT_RX terminal, this function transfer this ownership to another attached process.
    553  * The process descriptor must be in the process owner cluster.
    554  * This function does nothing if the <pid> process is not the owner.
     557 * The process descriptor must be the process owner.
     558 * This function does nothing if the process identified by the <process_xp> is not
     559 * the TXT owner.
    555560 * - If the current owner is not the KSH process, the new owner is the KSH process.
    556  * - If the <pid> process is the the KSH process, the new owner is another attached process.
     561 * - If the current owner is the KSH process, the new owner is another attached process.
    557562 * - If there is no other attached process, the TXT has no more defined owner.
    558563 *********************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.