discrepancy in guide on how to wake up a thread

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
hazelnusse
Posts: 77
Joined: Thu May 24, 2012 8:01 am

discrepancy in guide on how to wake up a thread

Post by hazelnusse »

In http://www.chibios.org/dokuwiki/doku.php?id=chibios:howtos:wakeup it has:

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?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: discrepancy in guide on how to wake up a thread

Post by Giovanni »

Hi,

Thanks for finding, it is a documentation error, that function can be called in any context (the state checker does not complain about it so it is OK).

Giovanni
hazelnusse
Posts: 77
Joined: Thu May 24, 2012 8:01 am

Re: discrepancy in guide on how to wake up a thread

Post by hazelnusse »

No problem, glad I could help.
Post Reply