laforge has submitted this change. (
https://gerrit.osmocom.org/c/libosmocore/+/17862 )
Change subject: timer.c: make timers thread safe
......................................................................
timer.c: make timers thread safe
This is implicitly used by the libosmocore select abstraction, which
might be used in multiple threads at the same time.
Change-Id: I5a3802c94af6ff0315f1553f20870342d51ce726
---
M src/timer.c
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/timer.c b/src/timer.c
index 0b2e3dd..d3129a7 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -40,10 +40,10 @@
#include <osmocom/core/linuxlist.h>
/* These store the amount of time that we wait until next timer expires. */
-static struct timeval nearest;
-static struct timeval *nearest_p;
+static __thread struct timeval nearest;
+static __thread struct timeval *nearest_p;
-static struct rb_root timer_root = RB_ROOT;
+static __thread struct rb_root timer_root = RB_ROOT;
static void __add_timer(struct osmo_timer_list *timer)
{
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/17862
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I5a3802c94af6ff0315f1553f20870342d51ce726
Gerrit-Change-Number: 17862
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-MessageType: merged