This is an automated email from the ASF dual-hosted git repository.
ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 1cb1005 kernel/os: Don't hang in os_time_delay() if !sched
1cb1005 is described below
commit 1cb100512fae447e42b3d1d9ed2d52ddf36a678d
Author: Christopher Collins <[email protected]>
AuthorDate: Wed Mar 6 10:21:30 2019 -0800
kernel/os: Don't hang in os_time_delay() if !sched
If the OS scheduler is disabled (`!MYNEWT_VAL(OS_SCHEDULING)`), then turn
`os_time_delay()` into a no-op.
Prior to this commit, this function would hang forever when scheduling
is disabled.
---
kernel/os/src/os_time.c | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/kernel/os/src/os_time.c b/kernel/os/src/os_time.c
index 7022694..0ca95f8 100644
--- a/kernel/os/src/os_time.c
+++ b/kernel/os/src/os_time.c
@@ -98,13 +98,6 @@ os_time_advance(int ticks)
}
}
}
-#else
-void
-os_time_advance(int ticks)
-{
- g_os_time += ticks;
-}
-#endif
void
os_time_delay(os_time_t osticks)
@@ -119,6 +112,21 @@ os_time_delay(os_time_t osticks)
}
}
+#else
+
+void
+os_time_advance(int ticks)
+{
+ g_os_time += ticks;
+}
+
+void
+os_time_delay(os_time_t osticks)
+{
+}
+
+#endif
+
/**
* Searches the list of registered time change listeners for the specified
* entry.