This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26235 )
Change subject: rate_ctr: Make it safe to call rate_ctr_init() several times
......................................................................
rate_ctr: Make it safe to call rate_ctr_init() several times
There might be library code that has rate counters, and if the main
program calls rate_ctr_init() a second time, we can skip the second
initialization.
Change-Id: I6f5342a77518599eb5ac9a0f0605917a78fcc387
---
M src/rate_ctr.c
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 4d99699..283858d 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -354,6 +354,10 @@
* \returns 0 on success; negative on error */
int rate_ctr_init(void *tall_ctx)
{
+ /* ignore repeated initialization */
+ if (osmo_timer_pending(&rate_ctr_timer))
+ return 0;
+
tall_rate_ctr_ctx = tall_ctx;
osmo_timer_setup(&rate_ctr_timer, rate_ctr_timer_cb, NULL);
osmo_timer_schedule(&rate_ctr_timer, 1, 0);
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26235
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I6f5342a77518599eb5ac9a0f0605917a78fcc387
Gerrit-Change-Number: 26235
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211115/4fa6dd84/attachment.htm>