summaryrefslogtreecommitdiff
path: root/src/scheduler.c
diff options
context:
space:
mode:
authorqiuyiuestc <[email protected]>2010-04-12 17:37:37 +0000
committerqiuyiuestc <[email protected]>2010-04-12 17:37:37 +0000
commitcbfb87fac1020380eca3b15b32ea738820059007 (patch)
tree23522eed21d5abc36ff4ff9fcbf69806cc13e627 /src/scheduler.c
parentadcbe9d53fbd9753a2f3037569e3d2db8876d0d8 (diff)
add module feature
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@614 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src/scheduler.c')
-rw-r--r--src/scheduler.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/scheduler.c b/src/scheduler.c
index c570b3dbbc..a414840850 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -35,6 +35,9 @@ rt_list_t rt_thread_priority_table[RT_THREAD_PRIORITY_MAX];
struct rt_thread* rt_current_thread;
rt_uint8_t rt_current_priority;
+#ifdef RT_USING_MODULE
+extern struct rt_module* rt_current_module;
+#endif
#if RT_THREAD_PRIORITY_MAX > 32
/* maximun priority level, 256 */
@@ -260,6 +263,11 @@ void rt_schedule()
from_thread = rt_current_thread;
rt_current_thread = to_thread;
+#ifdef RT_USING_MODULE
+ if(rt_current_thread->module_parent != RT_NULL)
+ rt_current_module = rt_current_thread->module_parent;
+#endif
+
#ifdef RT_USING_HOOK
if (rt_scheduler_hook != RT_NULL) rt_scheduler_hook(from_thread, to_thread);
#endif