Philippe Gerum wrote:
 > > +#ifdef CONFIG_XENO_OPT_STATS
 > > +static inline void xnpod_acc_exec_time(xnsched_t *sched,
 > > +                                       xnthread_t *threadout)
 > > +{
 > > +    xnticks_t now = xntimer_get_rawclock();
 > > +    threadout->stat.exec_time += now - sched->last_csw;
 > > +    sched->last_csw = now;
 > > +}
 > 
 > It would be better to only pass the thread pointer, then use the
 > thread->sched member. This would clearly explain the relationship
 > between both, and prevent any bugous attempt at mixing things.

Beware, when xnpod_schedule is called from within
xnpod_migrate_thread(), the sched pointer of the switched out thread is
the one of the destination cpu. So, passing the sched and threadout
pointers to xnpod_acc_exec_time is safer.


-- 


                                            Gilles Chanteperdrix.

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to