Skip to content

Commit

Permalink
Merge pull request #394 from Jer6y/master
Browse files Browse the repository at this point in the history
Update tos_task.c , fix a bug in tos_task_create_dy
  • Loading branch information
Supowang1989 authored Aug 15, 2023
2 parents ced4c07 + 851fee0 commit 56707e7
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 56707e7

Please sign in to comment.