Skip to content

[Fix bug] fix thread init bug #4891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/thread.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ static rt_err_t _rt_thread_init(struct rt_thread *thread,
thread->current_priority = priority;

thread->number_mask = 0;

#ifdef RT_USING_EVENT
thread->event_set = 0;
thread->event_info = 0;
#endif

#if RT_THREAD_PRIORITY_MAX > 32
thread->number = 0;
thread->high_mask = 0;
Expand Down Expand Up @@ -203,6 +209,13 @@ static rt_err_t _rt_thread_init(struct rt_thread *thread,
thread->lwp = RT_NULL;
#endif


#ifdef RT_USING_MODULE
thread->module_id = 0;
#endif

thread->user_data = 0;

RT_OBJECT_HOOK_CALL(rt_thread_inited_hook, (thread));

return RT_EOK;
Expand Down