Index: trunk/kernel/kern/thread.h
===================================================================
--- trunk/kernel/kern/thread.h	(revision 440)
+++ trunk/kernel/kern/thread.h	(revision 443)
@@ -77,5 +77,5 @@
 
 /***************************************************************************************
- * This defines the masks associated to the blocking causes.
+ * This defines the thread blocking causes bit-vector.
  **************************************************************************************/
 
@@ -278,6 +278,6 @@
 
 /***************************************************************************************
- * This function is called by the kernel_init() function to initialize the IDLE thread.
- * It initializes an existing thread descriptor from arguments values.
+ * This function is called by the kernel_init() function to initialize the IDLE thread
+ * descriptor from arguments values.
  * The THREAD_BLOCKED_GLOBAL bit is set, and the thread must be activated to start.
  ***************************************************************************************
@@ -296,20 +296,28 @@
 
 /***************************************************************************************
- * This function releases the physical memory allocated for a thread in a given cluster.
- * This include the thread descriptor itself, the associated CPU and FPU context, and
- * the physical memory allocated for an user thread local stack.
+ * This function is called by the sched_handle_signals() function to releases 
+ * the physical memory allocated for a thread in a given cluster, when this thread 
+ * is marked for delete. This include the thread descriptor itself, the associated 
+ * CPU and FPU context, and the physical memory allocated for an user thread local stack.
+ * The destroyed thread is removed from the local process th_tbl[] array, and returns 
+ * true when the destroyed thread was the last thread registered in process.
  ***************************************************************************************
  * @ thread  : pointer on the thread descriptor to release.
- **************************************************************************************/
-void thread_destroy( thread_t * thread );
+ * @ return true, if the thread was the last registerd thread in local process.
+ **************************************************************************************/
+bool_t thread_destroy( thread_t * thread );
 
 /***************************************************************************************
  * This function defines the code of the thread executed by all cores after kernel_init,
  * or when no other thread is runnable for a given core.
- *
- * TODO: In the TSAR architecture, it enters an infinite loop, in wich it forces
- * the core in sleep (low-power) mode. Any IRQ will force the core to exit this sleep
- * mode, but no ISR is executed.
- * TODO: We must analyse if we have the same behaviour for I86 architectures...
+ * It enter and infinite loop in wich:
+ * - it unmask the IRQs
+ * - it optionally calls the hal_core_sleep() function to reduce the power consumption
+ *   (this behavior is controlled by the CONFIG_THREAD_IDLE_MODE_SLEEP flag).
+ * - it call the sched_yield() function to find another runnable thread.
+ *
+ * TODO: In the TSAR architecture the hal_core_sleep() function forces the core to
+ * low-power mode. Any IRQ will force the core to exit this low-power mode, but no ISR
+ * is executed. We must analyse if we have the same behaviour for I86 architectures...
  **************************************************************************************/
 void thread_idle_func();
@@ -357,5 +365,5 @@
 /***************************************************************************************
  * This function is used by the four sys_thread_cancel(), sys_thread_exit(),
- * sys_kill() and sys_exit() system calls to delete a given thread. 
+ * sys_kill() and sys_exit() system calls to mark for delete a given thread. 
  * It set the THREAD_BLOCKED_GLOBAL bit and set the the THREAD_FLAG_REQ_DELETE bit
  * in the thread descriptor identified by the <thread_xp> argument, to ask the scheduler 
