sched: task: Fix to initialize the task-specific data

Summary:
- I noticed that getopt() test in ostest wailed with
  esp32-devkitc:smp and spresense:smp
- Finally, I found that the task-specific data is not
  initialized.
- This commit fixes this issue

Impact:
- None

Testing:
- Tested with ostest esp32-devkitc:smp and spresense:smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2021-04-03 21:33:16 +09:00 committed by patacongo
parent 9e311518c9
commit a51a60d485
1 changed files with 4 additions and 0 deletions

View File

@ -137,6 +137,10 @@ int nxtask_init(FAR struct task_tcb_s *tcb, const char *name, int priority,
group->tg_libvars = up_stack_frame(&tcb->cmn, sizeof(struct libvars_s));
DEBUGASSERT(group->tg_libvars != NULL);
/* Initialize the task-specific data */
memset(group->tg_libvars, 0, sizeof(struct libvars_s));
/* Save the allocated task data in TLS */
tls_set_taskdata(&tcb->cmn);