aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src/chregistry.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/src/chregistry.c')
-rw-r--r--os/rt/src/chregistry.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/os/rt/src/chregistry.c b/os/rt/src/chregistry.c
index a9646f478..043fb1516 100644
--- a/os/rt/src/chregistry.c
+++ b/os/rt/src/chregistry.c
@@ -134,6 +134,7 @@ thread_t *chRegFirstThread(void) {
tp->p_refs++;
#endif
chSysUnlock();
+
return tp;
}
@@ -153,8 +154,9 @@ thread_t *chRegNextThread(thread_t *tp) {
chSysLock();
ntp = tp->p_newer;
- if (ntp == (thread_t *)&ch.rlist)
+ if (ntp == (thread_t *)&ch.rlist) {
ntp = NULL;
+ }
#if CH_CFG_USE_DYNAMIC
else {
chDbgAssert(ntp->p_refs < 255, "too many references");
@@ -165,6 +167,7 @@ thread_t *chRegNextThread(thread_t *tp) {
#if CH_CFG_USE_DYNAMIC
chThdRelease(tp);
#endif
+
return ntp;
}