aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/chthreads.c3
-rw-r--r--src/templates/chconf.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/chthreads.c b/src/chthreads.c
index 4b61fe964..c41e3af6b 100644
--- a/src/chthreads.c
+++ b/src/chthreads.c
@@ -34,6 +34,9 @@ Thread *init_thread(Thread *tp, tprio_t prio) {
tp->p_flags = P_MEM_MODE_STATIC;
tp->p_prio = prio;
tp->p_state = PRSUSPENDED;
+#ifdef CH_USE_NESTED_LOCKS
+ tp->p_locks = 0;
+#endif
#ifdef CH_USE_MUTEXES
/* realprio is the thread's own, non-inherited, priority */
tp->p_realprio = prio;
diff --git a/src/templates/chconf.h b/src/templates/chconf.h
index 005748b83..7ce208aa0 100644
--- a/src/templates/chconf.h
+++ b/src/templates/chconf.h
@@ -39,7 +39,7 @@
* @p chSysUnlock() operations is allowed.<br>
* For performance and code size reasons the recommended setting is leave
* this option disabled.<br>
- * You can use this option if you need to merge with ChibiOS/RT external
+ * You can use this option if you need to merge ChibiOS/RT with external
* libraries that require nested lock/unlock operations.
*/
#define CH_USE_NESTED_LOCKS