Skip to content

Commit

Permalink
Update tos_task.c , fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jer6y authored Aug 15, 2023
1 parent ced4c07 commit 851fee0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/core/tos_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,21 @@ __API__ k_err_t tos_task_create_dyn(k_task_t **task,
tos_mmheap_free(the_task);
return K_ERR_OUT_OF_MEMORY;
}
TOS_CPU_CPSR_ALLOC();

TOS_CPU_INT_DISABLE();
the_task->stk_base = stk_base;
err = tos_task_create(the_task, name, entry, arg, prio, stk_base, stk_size, timeslice);
if (err != K_ERR_NONE) {
task_free(the_task);
TOS_CPU_INT_ENABLE();
return err;
}

knl_object_alloc_set_dynamic(&the_task->knl_obj);

*task = the_task;

TOS_CPU_INT_ENABLE();
return K_ERR_NONE;
}

Expand Down

0 comments on commit 851fee0

Please sign in to comment.