aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel')
-rw-r--r--os/kernel/include/events.h6
-rw-r--r--os/kernel/src/chregistry.c9
2 files changed, 11 insertions, 4 deletions
diff --git a/os/kernel/include/events.h b/os/kernel/include/events.h
index b333e07c5..42f415b73 100644
--- a/os/kernel/include/events.h
+++ b/os/kernel/include/events.h
@@ -145,9 +145,9 @@ extern "C" {
#endif
#if !CH_OPTIMIZE_SPEED && CH_USE_EVENTS_TIMEOUT
-#define chEvtWaitOne(ewmask) chEvtWaitOneTimeout(emask, TIME_INFINITE)
-#define chEvtWaitAny(ewmask) chEvtWaitAnyTimeout(emask, TIME_INFINITE)
-#define chEvtWaitAll(ewmask) chEvtWaitAllTimeout(emask, TIME_INFINITE)
+#define chEvtWaitOne(mask) chEvtWaitOneTimeout(mask, TIME_INFINITE)
+#define chEvtWaitAny(mask) chEvtWaitAnyTimeout(mask, TIME_INFINITE)
+#define chEvtWaitAll(mask) chEvtWaitAllTimeout(mask, TIME_INFINITE)
#endif
#endif /* CH_USE_EVENTS */
diff --git a/os/kernel/src/chregistry.c b/os/kernel/src/chregistry.c
index 05573acbf..b6555df40 100644
--- a/os/kernel/src/chregistry.c
+++ b/os/kernel/src/chregistry.c
@@ -43,7 +43,10 @@ Thread *chRegFirstThread(void) {
Thread *tp;
chSysLock();
- (tp = rlist.p_newer)->p_refs++;
+ tp = rlist.p_newer;
+#if CH_USE_DYNAMIC
+ tp->p_refs++;
+#endif
chSysUnlock();
return tp;
}
@@ -60,14 +63,18 @@ Thread *chRegFirstThread(void) {
Thread *chRegNextThread(Thread *tp) {
chSysLock();
+#if CH_USE_DYNAMIC
chDbgAssert(tp->p_refs > 0, "chRegNextThread(), #1",
"not referenced");
tp->p_refs--;
+#endif
if (tp->p_newer != (Thread *)&rlist) {
tp = tp->p_newer;
+#if CH_USE_DYNAMIC
chDbgAssert(tp->p_refs < 255, "chRegNextThread(), #2",
"too many references");
tp->p_refs++;
+#endif
}
else
tp = NULL;