You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/12/03 15:16:57 UTC

[GitHub] andrzej-kaczmarek opened a new pull request #1542: sys/stats: Allow stats to be registered before sysinit

andrzej-kaczmarek opened a new pull request #1542: sys/stats: Allow stats to be registered before sysinit
URL: https://github.com/apache/mynewt-core/pull/1542
 
 
   Some modules may want to register stats before sysinit, e.g. some BSP
   can create os_dev in hal_bsp_init and corresponding driver will try to
   register stats on device init which means before sysinit is called.
   
   To make this possible, stats code was modified a bit so it will
   automatically initialize itself on 1st register call in case it was not
   yet initialized via sysinit. This is possible since it does not have any
   extra dependencies.
   
   To avoid using some new global variables which hold initialization state
   we can just check stat for number of registered stats - it will be
   non-zero after initialization since "stat" is always registered.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services