mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 19:44:24 +08:00
Merge pull request #173 from grissiom/new-timer
kernel: use skip list to implement timer list
This commit is contained in:
+10
-1
@@ -410,6 +410,15 @@ struct rt_object_information
|
||||
#define RT_TIMER_CTRL_SET_ONESHOT 0x2 /**< change timer to one shot */
|
||||
#define RT_TIMER_CTRL_SET_PERIODIC 0x3 /**< change timer to periodic */
|
||||
|
||||
#ifndef RT_TIMER_SKIP_LIST_LEVEL
|
||||
#define RT_TIMER_SKIP_LIST_LEVEL 1
|
||||
#endif
|
||||
|
||||
/* 1 or 3 */
|
||||
#ifndef RT_TIMER_SKIP_LIST_MASK
|
||||
#define RT_TIMER_SKIP_LIST_MASK 0x3
|
||||
#endif
|
||||
|
||||
/**
|
||||
* timer structure
|
||||
*/
|
||||
@@ -417,7 +426,7 @@ struct rt_timer
|
||||
{
|
||||
struct rt_object parent; /**< inherit from rt_object */
|
||||
|
||||
rt_list_t list; /**< the node of timer list */
|
||||
rt_list_t row[RT_TIMER_SKIP_LIST_LEVEL];
|
||||
|
||||
void (*timeout_func)(void *parameter); /**< timeout function */
|
||||
void *parameter; /**< timeout function's parameter */
|
||||
|
||||
Reference in New Issue
Block a user