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/21 10:51:59 UTC

[GitHub] andrzej-kaczmarek opened a new pull request #279: nimble/host: Stop ble_hs_timer on startup only in unit tests

andrzej-kaczmarek opened a new pull request #279: nimble/host: Stop ble_hs_timer on startup only in unit tests
URL: https://github.com/apache/mynewt-nimble/pull/279
 
 
   `ble_hs_start()` tries to stop `ble_hs_timer` before init to make it work in unit tests which can call `ble_hs_start()` multiple times. Without this extra stop call, callouts list will be corrupted when init is called on a callout which is already queued.
   
   There's no easy way to fix unit tests since it's not quite possible to guarantee that each test case calls `ble_hs_start()` only once without refactoring some of them. To provide a quick fix for this, let's just
   call extra stop only for unit tests.
   
   This fixes issue with some NPL implementations which need to allocate some resources for callout on init and thus calling stop before init is not safe (like in Mynewt) and we do not really want to workaround this in NPL by adding checks everywhere.

----------------------------------------------------------------
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