Untangled some conditions.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14534 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
Giovanni Di Sirio 2021-06-12 06:41:14 +00:00
parent eb4b93f6cb
commit 24ea4a3706
1 changed files with 8 additions and 9 deletions

View File

@ -526,18 +526,17 @@ void chThdExitS(msg_t msg) {
#endif #endif
#if CH_CFG_USE_REGISTRY == TRUE #if CH_CFG_USE_REGISTRY == TRUE
/* Static threads with no references are immediately removed from the if (unlikely(currtp->refs == (trefs_t)0)) {
registry because there is no memory to recover.*/
#if CH_CFG_USE_DYNAMIC == TRUE #if CH_CFG_USE_DYNAMIC == TRUE
if (unlikely((currtp->refs == (trefs_t)0) && /* Static threads are immediately removed from the registry because there
((currtp->flags & CH_FLAG_MODE_MASK) == CH_FLAG_MODE_STATIC))) { is no memory to recover.*/
if (unlikely(((currtp->flags & CH_FLAG_MODE_MASK) == CH_FLAG_MODE_STATIC))) {
REG_REMOVE(currtp); REG_REMOVE(currtp);
} }
#else #else
if (unlikely(currtp->refs == (trefs_t)0)) {
REG_REMOVE(currtp); REG_REMOVE(currtp);
}
#endif #endif
}
#endif #endif
/* Going into final state.*/ /* Going into final state.*/