summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
authorfenghuijie <[email protected]>2021-07-05 18:33:22 +0800
committerfenghuijie <[email protected]>2021-07-05 18:33:22 +0800
commit0015af02e4f08ab47f2d2fefcb7c1aca1682bfda (patch)
treefded7632c1ea03699173ce94ba627544669786f1 /src/thread.c
parente933c1f6105caf4e68bd57bc5521767b32063a5f (diff)
调整代码,以支持cpu usage
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/thread.c b/src/thread.c
index 88cc7b61ba..60e6ab91d1 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -228,6 +228,10 @@ static rt_err_t _rt_thread_init(struct rt_thread *thread,
thread->lwp = RT_NULL;
#endif /* RT_USING_LWP */
+#ifdef RT_USING_CPU_USAGE
+ thread->duration_tick = 0;
+#endif
+
RT_OBJECT_HOOK_CALL(rt_thread_inited_hook, (thread));
return RT_EOK;