rtems_event_receive() return code question

Sergei Organov osv at topconrd.ru
Mon Feb 2 17:12:51 UTC 2004


"Thomas Rauscher" <trauscher at loytec.com> writes:
> Hi,
> 
> I've a question regarding the rtems_event_receive() semantics.
> The API documentation unfortunately leaves some open questions.
> 
> If a rtems_event_receive() function is called with timeout, but
> receives events just while returning after a timeout, is it correct to
> return RTEMS_TIMEOUT but have the event_out parameter set to
> a satisfying event set?

While not explicitly documented, the 'event_out' is left untouched when
RTEMS_TIMEOUT is returned. Thus, you need to initialize it to 0 before calling
rtems_event_receive() (it's almost always a good idea to initialize all your
variables anyway). Alternatively, check return code and don't use 'event_out'
when something other than RTEMS_SUCCESSFUL is returned.

-- 
Sergei.





More information about the users mailing list