[riot-notifications] [RIOT-OS/RIOT] core/schedstatistics: fix call to uninitialized xtimer (#11781)

Francisco notifications at github.com
Tue Jul 30 14:11:06 CEST 2019

We discussed about this IRL with @cladmi and made the following changes:

- Moved `init_schedstatistics()` to `auto_init` just after `xtimer_init()`, that way `laststart` for the main thread will be as close as possible to the start of the thread and before any threads can be potentially started by `auto_init`, while waiting for `xtimer_init()` to be called.
- On `init_schedstatistics()`  the value for  `laststart` is set to `xtimer_now()`. Before it was assumed to be 0 but that depends on the underlying `timer_init`. This way we are sure to consider the start of the thread and not take into account what may be happening in the underlying `timer init` (i.e. if for example it is already running and has an initial value matching RIOT's initialization time before actually starting `main`).

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190730/2b510f4f/attachment.htm>

More information about the notifications mailing list