You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/07/12 23:33:29 UTC

incubator-mynewt-core git commit: os - g_task_list initialized incorrectly.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop f27fdb23d -> 5806fa0d9


os - g_task_list initialized incorrectly.

g_task_list is a STAILQ, but it was being externed and initialized as a
TAILQ.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/5806fa0d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/5806fa0d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/5806fa0d

Branch: refs/heads/develop
Commit: 5806fa0d948684cf0b54d7bce47de07f0143894e
Parents: f27fdb2
Author: Christopher Collins <cc...@apache.org>
Authored: Tue Jul 12 16:25:25 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Tue Jul 12 16:25:25 2016 -0700

----------------------------------------------------------------------
 libs/os/src/arch/sim/os_arch_sim.c | 2 +-
 libs/os/src/os.c                   | 1 +
 libs/os/src/os_priv.h              | 5 ++++-
 libs/os/src/os_task.c              | 3 ++-
 4 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5806fa0d/libs/os/src/arch/sim/os_arch_sim.c
----------------------------------------------------------------------
diff --git a/libs/os/src/arch/sim/os_arch_sim.c b/libs/os/src/arch/sim/os_arch_sim.c
index 287b4fc..4970522 100644
--- a/libs/os/src/arch/sim/os_arch_sim.c
+++ b/libs/os/src/arch/sim/os_arch_sim.c
@@ -404,7 +404,7 @@ os_arch_os_init(void)
     mypid = getpid();
     g_current_task = NULL;
 
-    TAILQ_INIT(&g_os_task_list);
+    STAILQ_INIT(&g_os_task_list);
     TAILQ_INIT(&g_os_run_list);
     TAILQ_INIT(&g_os_sleep_list);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5806fa0d/libs/os/src/os.c
----------------------------------------------------------------------
diff --git a/libs/os/src/os.c b/libs/os/src/os.c
index cbca765..90f972e 100644
--- a/libs/os/src/os.c
+++ b/libs/os/src/os.c
@@ -107,6 +107,7 @@ os_init(void)
     os_error_t err;
 
     TAILQ_INIT(&g_callout_list);
+    STAILQ_INIT(&g_os_task_list);
 
     err = os_arch_os_init();
     assert(err == OS_OK);

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5806fa0d/libs/os/src/os_priv.h
----------------------------------------------------------------------
diff --git a/libs/os/src/os_priv.h b/libs/os/src/os_priv.h
index 9566546..ddc656b 100644
--- a/libs/os/src/os_priv.h
+++ b/libs/os/src/os_priv.h
@@ -20,12 +20,15 @@
 #ifndef H_OS_PRIV_
 #define H_OS_PRIV_
 
+#include "os/queue.h"
+
 TAILQ_HEAD(os_task_list, os_task);
 TAILQ_HEAD(os_callout_list, os_callout);
+STAILQ_HEAD(os_task_stailq, os_task);
 
 extern struct os_task_list g_os_run_list;
 extern struct os_task_list g_os_sleep_list;
-extern struct os_task_list g_os_task_list;
+extern struct os_task_stailq g_os_task_list;
 extern struct os_task *g_current_task;
 extern struct os_callout_list g_callout_list;
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5806fa0d/libs/os/src/os_task.c
----------------------------------------------------------------------
diff --git a/libs/os/src/os_task.c b/libs/os/src/os_task.c
index 55c1da2..e48fdf9 100644
--- a/libs/os/src/os_task.c
+++ b/libs/os/src/os_task.c
@@ -19,12 +19,13 @@
 
 
 #include "os/os.h"
+#include "os_priv.h"
 
 #include <string.h>
 
 uint8_t g_task_id;
 
-STAILQ_HEAD(, os_task) g_os_task_list = STAILQ_HEAD_INITIALIZER(g_os_task_list);
+struct os_task_stailq g_os_task_list;
 
 static void
 _clear_stack(os_stack_t *stack_bottom, int size)