diff options
| author | Catalin Patulea <cat@vv.carleton.ca> | 2007-10-01 04:13:17 +0000 |
|---|---|---|
| committer | Catalin Patulea <cat@vv.carleton.ca> | 2007-10-01 04:13:17 +0000 |
| commit | ea47ee64f02030c64e0472939ea3c588ce7e8dab (patch) | |
| tree | 5ac1c94b6c0e13cd6a36c86f22684d6b60618dc7 | |
| parent | eb202355a7ad24f030ac09c5860ece105cb21f38 (diff) | |
| download | rockbox-ea47ee64f02030c64e0472939ea3c588ce7e8dab.zip rockbox-ea47ee64f02030c64e0472939ea3c588ce7e8dab.tar.gz rockbox-ea47ee64f02030c64e0472939ea3c588ce7e8dab.tar.bz2 rockbox-ea47ee64f02030c64e0472939ea3c588ce7e8dab.tar.xz | |
Watch out for uninitialized threads[] in init_threads() which can cause big headaches later in unrelated places.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14934 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/thread.c | 7 |
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; |