strange chDbgAssert in chthreads.c
Posted: Wed Aug 27, 2014 6:34 am
Hello, Giovanni!
In function:
Sorry, but I don't fully understand the purpose of "chDbgAssert(*trp == NULL, "not NULL");"
Later, we assign the value of "tp" to it, so why sould we check it?
Maybe there should be
?
In function:
Code: Select all
msg_t chThdSuspendTimeoutS(thread_reference_t *trp, systime_t timeout) {
thread_t *tp = chThdGetSelfX();
chDbgAssert(*trp == NULL, "not NULL");
if (TIME_IMMEDIATE == timeout)
return MSG_TIMEOUT;
*trp = tp;
tp->p_u.wtobjp = &trp;
return chSchGoSleepTimeoutS(CH_STATE_SUSPENDED, timeout);
}Sorry, but I don't fully understand the purpose of "chDbgAssert(*trp == NULL, "not NULL");"
Later, we assign the value of "tp" to it, so why sould we check it?
Maybe there should be
Code: Select all
chDbgAssert(trp == NULL, "not NULL");?