summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/thread.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/thread.c b/firmware/thread.c
index bb3c321..3508a64 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -1038,6 +1038,13 @@ void init_threads(void)
/* CPU will initialize first and then sleep */
slot = find_empty_thread_slot();
+#if THREAD_EXTRA_CHECKS
+ /* This can fail if, for example, .bss isn't zero'ed out by the loader
+ or threads is in the wrong section. */
+ if (slot < 0) {
+ panicf("uninitialized threads[]");
+ }
+#endif
cores[core].sleeping = NULL;
cores[core].running = NULL;