You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/06/27 20:15:17 UTC
[GitHub] ccollins476ad closed pull request #1228: kernel/os: Preempt when
high priority task created
ccollins476ad closed pull request #1228: kernel/os: Preempt when high priority task created
URL: https://github.com/apache/mynewt-core/pull/1228
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/kernel/os/src/os_task.c b/kernel/os/src/os_task.c
index 74cfcebdd8..ff822769c9 100644
--- a/kernel/os/src/os_task.c
+++ b/kernel/os/src/os_task.c
@@ -114,6 +114,13 @@ os_task_init(struct os_task *t, const char *name, os_task_func_t func,
os_trace_task_create(t);
os_trace_task_info(t);
+ /* Allow a preemption in case the new task has a higher priority than the
+ * current one.
+ */
+ if (os_started()) {
+ os_sched(NULL);
+ }
+
return (0);
err:
return (rc);
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services