Code: Select all
/* Waiting for the IRQ to happen.*/
chSysLock();
tp = chThdSelf();
chSchGoSleepS(THD_STATE_SUSPENDED);
msg = chThdSelf()->p_u.rdymsg; /* Retrieving the message, optional.*/
chSysUnlock();
In the API docs for chThdSelf() it says:
Normal API, this function can be invoked by regular system threads but not from within a lock zone.
Is the API doc incorrect, or is the guide incorrect?