diff options
| author | Jeff Epler <jepler@gmail.com> | 2020-07-10 14:42:21 -0500 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2020-07-15 09:26:47 -0500 |
| commit | 36b46465167f15eaf8535608b16859e6de10fac8 (patch) | |
| tree | 55d5de3eeb516c1853337416c0da754eb333d1c0 | |
| parent | af520729fe9d941c293942730f520b50ec1daf52 (diff) | |
background_callback: Avoid CALLBACK_CRITICAL_BEGIN with nothing to do
CALLBACK_CRITICAL_BEGIN is heavyweight, but we can be confident we do
not have work to do as long as callback_head is NULL.
This gives back performance on nRF.
| -rw-r--r-- | supervisor/shared/background_callback.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index 99607b7a8..e45c9b5c3 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -61,8 +61,11 @@ void background_callback_add(background_callback_t *cb, background_callback_fun static bool in_background_callback; void background_callback_run_all() { + if (!callback_head) { + return; + } CALLBACK_CRITICAL_BEGIN; - if(in_background_callback) { + if (in_background_callback) { CALLBACK_CRITICAL_END; return; } |
