Index: trunk/kernel/kern/process.h
===================================================================
--- trunk/kernel/kern/process.h	(revision 441)
+++ trunk/kernel/kern/process.h	(revision 443)
@@ -90,6 +90,6 @@
  * The process descriptor is replicated in all clusters containing at least one thread 
  * of the PID process, with the following rules :
- * 1) The <pid>, <ppid>, <ref_xp>, <vfs_root_xp>, <vfs_bin_xp>  fields are defined
- *    in all process descriptor copies.
+ * 1) The <pid>, <ppid>, <ref_xp>, <owner_xp>, <vfs_root_xp>, <vfs_bin_xp>  fields are 
+ *    defined in all process descriptor copies.
  * 2) The <vfs_cwd_xp> and associated <cwd_lock>, that can be dynamically modified,
  *    are only defined in the reference process descriptor.
@@ -106,5 +106,5 @@
  *    are defined in all process descriptors copies.
  * 7) The termination <flags> and <exit_status> are only defined in the reference cluster.
- *    The term state format is defined in the shared_syscalls.h file.
+ *    The term_state format is defined in the shared_syscalls.h file.
  ********************************************************************************************/
 
@@ -119,4 +119,5 @@
 	pid_t             pid;              /*! process identifier                              */
     xptr_t            ref_xp;           /*! extended pointer on reference process           */
+    xptr_t            owner_xp;         /*! extended pointer on owner process               */
     xptr_t            parent_xp;        /*! extended pointer on parent process              */
 
@@ -264,8 +265,10 @@
 /*********************************************************************************************
  * This debug function diplays on the kernel terminal TXT0 detailed informations on a 
- * reference process identified by the <process_xp> argument.
+ * process descriptor identified by the <process_xp> argument.
  * It can be called by a thread running in any cluster.
- *********************************************************************************************
- * @ process_xp : extended pointer on reference process.
+ * WARNING: this function uses the nolock_printk() function, and the  TXT0 lock MUST be
+ * taken by the caller function. 
+ *********************************************************************************************
+ * @ process_xp : extended pointer on process descriptor.
  ********************************************************************************************/
 void process_display( xptr_t process_xp );
@@ -379,9 +382,9 @@
 
 /*********************************************************************************************
- * This function implements the "fork" system call, and is called by the sys_fork() function. 
- * It allocates memory and initializes a new "child" process descriptor, and the
- * associated "child" thread descriptor in the local cluster. This function can involve
- * up to three different clusters :
- * - the child (local) cluster can be any cluster defined by the sys_fork function.
+ * This function implements the "fork" system call, and is called by the sys_fork() function,
+ * likely throuch the RPC_PROCESS_MAKE_FORK. 
+ * It allocates memory and initializes a new "child" process descriptor, and the associated
+ * "child" thread descriptor in local cluster. It involves up to three different clusters :
+ * - the child (local) cluster can be any cluster selected by the sys_fork function.
  * - the parent cluster must be the reference cluster for the parent process.
  * - the client cluster containing the thread requesting the fork can be any cluster.
@@ -483,5 +486,5 @@
  * It checks that there is an available slot in the local th_tbl[] array,
  * allocates a new LTID, and registers the new thread in the th_tbl[].
- * WARNING : the lock protecting the th_tbl[] must be taken by the caller.
+ * It takes the lock protecting exclusive access to the th_tbl[].
  *********************************************************************************************
  * @ process  : pointer on the local process descriptor.
@@ -496,9 +499,10 @@
 /*********************************************************************************************
  * This function removes a thread registration from the local process descriptor.
- * WARNING : the lock protecting the th_tbl[] must be taken by the caller.
+ * It takes the lock protecting exclusive access to the th_tbl[].
  *********************************************************************************************
  * @ thread   : local pointer on thread to be removed.
- ********************************************************************************************/
-void process_remove_thread( struct thread_s * thread );
+ * @ return true if the removed thread was the last registered thread.
+ ********************************************************************************************/
+bool_t process_remove_thread( struct thread_s * thread );
 
 
@@ -551,8 +555,9 @@
  * When the process dentified by the <owner_xp> argument has the exclusive ownership of
  * the TXT_RX terminal, this function transfer this ownership to another attached process.
- * The process descriptor must be in the process owner cluster.
- * This function does nothing if the <pid> process is not the owner.
+ * The process descriptor must be the process owner.
+ * This function does nothing if the process identified by the <process_xp> is not 
+ * the TXT owner.
  * - If the current owner is not the KSH process, the new owner is the KSH process.
- * - If the <pid> process is the the KSH process, the new owner is another attached process.
+ * - If the current owner is the KSH process, the new owner is another attached process.
  * - If there is no other attached process, the TXT has no more defined owner. 
  *********************************************************************************************
