commit
05d8045a24
@ -173,6 +173,7 @@ void rt_schedule_remove_thread(struct rt_thread *thread);
|
|||||||
|
|
||||||
void rt_enter_critical(void);
|
void rt_enter_critical(void);
|
||||||
void rt_exit_critical(void);
|
void rt_exit_critical(void);
|
||||||
|
rt_uint16_t rt_critical_level(void);
|
||||||
|
|
||||||
#ifdef RT_USING_HOOK
|
#ifdef RT_USING_HOOK
|
||||||
void rt_scheduler_sethook(void (*hook)(rt_thread_t from, rt_thread_t to));
|
void rt_scheduler_sethook(void (*hook)(rt_thread_t from, rt_thread_t to));
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
* 2006-03-23 Bernard the first version
|
* 2006-03-23 Bernard the first version
|
||||||
* 2010-11-10 Bernard add cleanup callback function in thread exit.
|
* 2010-11-10 Bernard add cleanup callback function in thread exit.
|
||||||
* 2012-12-29 Bernard fix compiling warning.
|
* 2012-12-29 Bernard fix compiling warning.
|
||||||
|
* 2013-12-21 Grissiom let rt_thread_idle_excute loop until there is no
|
||||||
|
* dead thread.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <rthw.h>
|
#include <rthw.h>
|
||||||
@ -72,8 +74,9 @@ void rt_thread_idle_sethook(void (*hook)(void))
|
|||||||
*/
|
*/
|
||||||
void rt_thread_idle_excute(void)
|
void rt_thread_idle_excute(void)
|
||||||
{
|
{
|
||||||
/* check the defunct thread list */
|
/* Loop until there is no dead thread. So one call to rt_thread_idle_excute
|
||||||
if (!rt_list_isempty(&rt_thread_defunct))
|
* will do all the cleanups. */
|
||||||
|
while (!rt_list_isempty(&rt_thread_defunct))
|
||||||
{
|
{
|
||||||
rt_base_t lock;
|
rt_base_t lock;
|
||||||
rt_thread_t thread;
|
rt_thread_t thread;
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
* issue found by kuronca
|
* issue found by kuronca
|
||||||
* 2010-12-13 Bernard add defunct list initialization even if not use heap.
|
* 2010-12-13 Bernard add defunct list initialization even if not use heap.
|
||||||
* 2011-05-10 Bernard clean scheduler debug log.
|
* 2011-05-10 Bernard clean scheduler debug log.
|
||||||
|
* 2013-12-21 Grissiom add rt_critical_level
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
@ -398,5 +399,14 @@ void rt_exit_critical(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the scheduler lock level
|
||||||
|
*
|
||||||
|
* @return the level of the scheduler lock. 0 means unlocked.
|
||||||
|
*/
|
||||||
|
rt_uint16_t rt_critical_level(void)
|
||||||
|
{
|
||||||
|
return rt_scheduler_lock_nest;
|
||||||
|
}
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user