aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric <ewild@sysmocom.de>2020-04-19 02:09:28 +0200
committerEric <ewild@sysmocom.de>2020-04-19 02:21:05 +0200
commit06747d572029d4418e13e22902a70974f2e9b864 (patch)
treeaf709ef01b09c9ff25524d0d16b8be64897c728c /src
parenta70ac85f5bf0d9a7bc0eeae94d38bd680bea5ebb (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/timer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timer.c b/src/timer.c
index 0b2e3dd3..d3129a73 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)
{