Index: trunk/kernel/kern/process.h
===================================================================
--- trunk/kernel/kern/process.h	(revision 415)
+++ trunk/kernel/kern/process.h	(revision 416)
@@ -267,18 +267,22 @@
 
 /*********************************************************************************************
- * This function allows any thread running in any cluster to block, unblock  or delete
- * all threads of a given process identified by the <process> argument, dependig on the
- * <acion_type> argument. 
- * It can be called by the sys_kill() or sys_exit() functions to handle the "kill" & "exit"
- * system calls, or by the process_make_exec() function to handle the "exec" system call.
- * It must be executed in the owner cluster for the target process (using the relevant RPC
- * (RPC_PROCESS_SIGNAL or RPC_PROCESS_EXEC) if the client thread in not running in the
- * owner cluster.
- * It uses the multicast, non blocking, RPC_PROCESS_KILL to send the signal to all process
- * copies in parallel, block & deschedule when all signals have been sent, and finally
- * returns only when all responses have been received and the operation is completed. 
- *********************************************************************************************
- * @ process     : pointer on the process descriptor.
- * @ action_type   : BLOCK_ALL_THREADS / UNBLOCK_ALL_THREADS / DELETE_ALL_THREADS
+ * This function allows a client thread running in the owner cluster of a process identified
+ * by the <process> argument to block, unblock or delete all threads of the target process,
+ * depending on the <action_type> argument.  The scenario is the following:
+ * - It uses the multicast, non blocking rpc_process_sigaction_client() function to send
+ *   parallel requests to all remote clusters containing a process copy. Then it blocks
+ $   and deschedule to wait completion of these parrallel requests.
+ * - In each remote cluster, the rpc_process_sigaction_server() function, calls directly
+ *   the relevant process_block(), process_unblock(), or process_delete() function, and
+ *   decrement the responses counter to signal completion. The last server unblock
+ *   the client thread.
+ * - Finally, the client thread calls directly the process_block(), process_unblock(), or
+ *   process_delete() function in the owner cluster.
+ * It is used by the sys_kill() & sys_exit() functions to handle the "kill" & "exit" syscalls.
+ * It is also used by the process_make_exec() function to handle the "exec" syscall.
+ * WARNING : the DELETE and the BLOCK actions are NOT executed on the client thread.
+ *********************************************************************************************
+ * @ process     : pointer on the process descriptor in owner cluster.
+ * @ action_type : BLOCK_ALL_THREADS / UNBLOCK_ALL_THREADS / DELETE_ALL_THREADS
  ********************************************************************************************/
 void process_sigaction( process_t * process,
@@ -287,50 +291,39 @@
 /*********************************************************************************************
  * This function blocks all threads of a given user process in a given cluster.
- * It is always called by a local RPC thread, through the multicast RPC_PROCESS_KILL.
- * It loop on all local threads of the process, requesting the relevant schedulers to
- * block and deschedule these threads, using IPI if required. The threads are not detached 
- * from the scheduler, and not detached from the local process.
- * It acknowledges the client thread in the owner cluster only when all process threads
- * are descheduled and blocked on the BLOCKED_GLOBAL condition, using the <rsp_xp> argument.
+ * It loops on all local threads of the process, set the THREAD_BLOCKED_GLOBAL bit, 
+ * and request the relevant schedulers to acknowledge the blocking, using IPI if required. 
+ * The threads are not detached from the scheduler, and not detached from the local process.
+ * This function returns only when all blockable threads in cluster are actually blocked.
+ * WARNING : the client thread defined by the <client_xp> argument is NOT blocked.
  *********************************************************************************************
  * @ process     : pointer on the target process descriptor.
- * @ rsp_xp      : extended pointer on the response counter. 
- * # client_xp   : extended pointer on client thread descriptor.
+ * @ client_xp   : extended pointer on the client thread, that should not be blocked.
  ********************************************************************************************/
 void process_block( process_t * process,
-                    xptr_t      rsp_xp,
                     xptr_t      client_xp );
 
 /*********************************************************************************************
  * This function unblocks all threads of a given user process in a given cluster.
- * It is always called by a local RPC thread, through the multicast RPC_PROCESS_KILL.
- * It loops on local threads of the process, to reset the BLOCKED_GLOBAL bit in all threads.
- * It acknowledges directly the client thread in the owner cluster when this is done, 
- * using the <rsp_xp> argument.
  *********************************************************************************************
  * @ process     : pointer on the process descriptor.
- * @ rsp_xp      : extended pointer on the response counter. 
- * # client_xp   : extended pointer on client thread descriptor.
- ********************************************************************************************/
-void process_unblock( process_t * process,
-                      xptr_t      rsp_xp,
-                      xptr_t      client_xp );
-
-/*********************************************************************************************
- * This function delete all threads descriptors, of given user process in a given cluster.
- * It is always called by a local RPC thread, through the multicast RPC_PROCESS_KILL.
- * It detach all process threads from the scheduler, detach the threads from the local
- * process, and release the local memory allocated to threads descriptors (including the 
- * associated structures such as CPU and FPU context). Finally, it release the memory
- * allocated to the local process descriptor itself, but only when the local cluster
- * is NOT the process owner, but only a copy.  It acknowledges directly the client thread 
- * in the owner cluster, using ithe <rsp_xp> argument.
+ ********************************************************************************************/
+void process_unblock( process_t * process );
+
+/*********************************************************************************************
+ * This function delete all threads, of a given user process in a given cluster.
+ * It loops on all local threads of the process, and set the THREAD_FLAG_REQ_DELETE bit.
+ * For each marked thread, the following actions will be done by the scheduler at the next
+ * scheduling point: 
+ * - the thread will be detached from the scheduler.
+ * - the thread will be detached from the local process descriptor.
+ * - the thread will be detached from parent if required.
+ * - the memory allocated to the thread descriptor is released.
+ * - the memory allocated to the process descriptor is released, if it is the last thread.
+ * WARNING : the client thread defined by the <client_xp> argument is NOT deleted.
  *********************************************************************************************
  * @ process     : pointer on the process descriptor.
- * @ rsp_xp      : extended pointer on the response counter. 
- * # client_xp   : extended pointer on client thread descriptor.
+ * @ client_xp   : extended pointer on the client thread, that should not be deleted.
  ********************************************************************************************/
 void process_delete( process_t * process,
-                     xptr_t      rsp_xp,
                      xptr_t      client_xp );
 
@@ -392,10 +385,10 @@
  * It must be executed by a thread running in the calling process owner cluster.
  * It uses twice the multicast RPC_PROCESS_SIGNAL to first block all process threads
- * in all clusters, and then delete all thread  and process descriptors.
- *********************************************************************************************
- * @ process  : pointer on process descriptor in owner cluster.
+ * in all clusters, and then delete all threads and process descriptors.
+ *********************************************************************************************
+ * @ pid      : process identifier.
  * @ status   : exit return value.
  ********************************************************************************************/
-void process_make_exit( process_t * process,
+void process_make_exit( pid_t       pid,
                         uint32_t    status );
 
@@ -408,9 +401,9 @@
  * all process threads in all clusters, and then delete process descriptors.
  *********************************************************************************************
- * @ process  : pointer on process descriptor in owner cluster.
- * @ sig_id   : signal type.
- ********************************************************************************************/
-void process_make_kill( process_t * process,
-                        uint32_t    sig_id );
+ * @ pid     : process identifier.
+ * @ sig_id  : signal type.
+ ********************************************************************************************/
+void process_make_kill( pid_t     pid,
+                        uint32_t  sig_id );
 
 
