<p>Hoernchen has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17862">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">timer.c: make timers thread safe<br><br>This is implicitly used by the libosmocore select abstraction, which<br>might be used in multiple threads at the same time.<br><br>Change-Id: I5a3802c94af6ff0315f1553f20870342d51ce726<br>---<br>M src/timer.c<br>1 file changed, 3 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/62/17862/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/timer.c b/src/timer.c</span><br><span>index 0b2e3dd..d3129a7 100644</span><br><span>--- a/src/timer.c</span><br><span>+++ b/src/timer.c</span><br><span>@@ -40,10 +40,10 @@</span><br><span> #include <osmocom/core/linuxlist.h></span><br><span> </span><br><span> /* These store the amount of time that we wait until next timer expires. */</span><br><span style="color: hsl(0, 100%, 40%);">-static struct timeval nearest;</span><br><span style="color: hsl(0, 100%, 40%);">-static struct timeval *nearest_p;</span><br><span style="color: hsl(120, 100%, 40%);">+static __thread struct timeval nearest;</span><br><span style="color: hsl(120, 100%, 40%);">+static __thread struct timeval *nearest_p;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static struct rb_root timer_root = RB_ROOT;</span><br><span style="color: hsl(120, 100%, 40%);">+static __thread struct rb_root timer_root = RB_ROOT;</span><br><span> </span><br><span> static void __add_timer(struct osmo_timer_list *timer)</span><br><span> {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/17862">change 17862</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/17862"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I5a3802c94af6ff0315f1553f20870342d51ce726 </div>
<div style="display:none"> Gerrit-Change-Number: 17862 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Hoernchen <ewild@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>