Ignore:
Timestamp:
May 16, 2018, 4:15:22 PM (6 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/thread.h

    r440 r443  
    7777
    7878/***************************************************************************************
    79  * This defines the masks associated to the blocking causes.
     79 * This defines the thread blocking causes bit-vector.
    8080 **************************************************************************************/
    8181
     
    278278
    279279/***************************************************************************************
    280  * This function is called by the kernel_init() function to initialize the IDLE thread.
    281  * It initializes an existing thread descriptor from arguments values.
     280 * This function is called by the kernel_init() function to initialize the IDLE thread
     281 * descriptor from arguments values.
    282282 * The THREAD_BLOCKED_GLOBAL bit is set, and the thread must be activated to start.
    283283 ***************************************************************************************
     
    296296
    297297/***************************************************************************************
    298  * This function releases the physical memory allocated for a thread in a given cluster.
    299  * This include the thread descriptor itself, the associated CPU and FPU context, and
    300  * the physical memory allocated for an user thread local stack.
     298 * This function is called by the sched_handle_signals() function to releases
     299 * the physical memory allocated for a thread in a given cluster, when this thread
     300 * is marked for delete. This include the thread descriptor itself, the associated
     301 * CPU and FPU context, and the physical memory allocated for an user thread local stack.
     302 * The destroyed thread is removed from the local process th_tbl[] array, and returns
     303 * true when the destroyed thread was the last thread registered in process.
    301304 ***************************************************************************************
    302305 * @ thread  : pointer on the thread descriptor to release.
    303  **************************************************************************************/
    304 void thread_destroy( thread_t * thread );
     306 * @ return true, if the thread was the last registerd thread in local process.
     307 **************************************************************************************/
     308bool_t thread_destroy( thread_t * thread );
    305309
    306310/***************************************************************************************
    307311 * This function defines the code of the thread executed by all cores after kernel_init,
    308312 * or when no other thread is runnable for a given core.
    309  *
    310  * TODO: In the TSAR architecture, it enters an infinite loop, in wich it forces
    311  * the core in sleep (low-power) mode. Any IRQ will force the core to exit this sleep
    312  * mode, but no ISR is executed.
    313  * TODO: We must analyse if we have the same behaviour for I86 architectures...
     313 * It enter and infinite loop in wich:
     314 * - it unmask the IRQs
     315 * - it optionally calls the hal_core_sleep() function to reduce the power consumption
     316 *   (this behavior is controlled by the CONFIG_THREAD_IDLE_MODE_SLEEP flag).
     317 * - it call the sched_yield() function to find another runnable thread.
     318 *
     319 * TODO: In the TSAR architecture the hal_core_sleep() function forces the core to
     320 * low-power mode. Any IRQ will force the core to exit this low-power mode, but no ISR
     321 * is executed. We must analyse if we have the same behaviour for I86 architectures...
    314322 **************************************************************************************/
    315323void thread_idle_func();
     
    357365/***************************************************************************************
    358366 * This function is used by the four sys_thread_cancel(), sys_thread_exit(),
    359  * sys_kill() and sys_exit() system calls to delete a given thread.
     367 * sys_kill() and sys_exit() system calls to mark for delete a given thread.
    360368 * It set the THREAD_BLOCKED_GLOBAL bit and set the the THREAD_FLAG_REQ_DELETE bit
    361369 * in the thread descriptor identified by the <thread_xp> argument, to ask the scheduler
Note: See TracChangeset for help on using the changeset viewer.