<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16098] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16098">16098</a></dd>
<dt>Author</dt> <dd>anthm</dd>
<dt>Date</dt> <dd>2009-12-30 14:55:04 -0600 (Wed, 30 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>more timer changes</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcincludeprivateswitch_core_pvth">freeswitch/trunk/src/include/private/switch_core_pvt.h</a></li>
<li><a href="#freeswitchtrunksrcincludeswitch_coreh">freeswitch/trunk/src/include/switch_core.h</a></li>
<li><a href="#freeswitchtrunksrcswitch_corec">freeswitch/trunk/src/switch_core.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_core_sessionc">freeswitch/trunk/src/switch_core_session.c</a></li>
<li><a href="#freeswitchtrunksrcswitch_timec">freeswitch/trunk/src/switch_time.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcincludeprivateswitch_core_pvth"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/private/switch_core_pvt.h (16097 => 16098)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/private/switch_core_pvt.h        2009-12-30 20:45:37 UTC (rev 16097)
+++ freeswitch/trunk/src/include/private/switch_core_pvt.h        2009-12-30 20:55:04 UTC (rev 16098)
</span><span class="lines">@@ -218,6 +218,19 @@
</span><span class="cx"> 
</span><span class="cx"> extern struct switch_runtime runtime;
</span><span class="cx"> 
</span><ins>+
+struct switch_session_manager {
+        switch_memory_pool_t *memory_pool;
+        switch_hash_t *session_table;
+        uint32_t session_count;
+        uint32_t session_limit;
+        switch_size_t session_id;
+};
+
+extern struct switch_session_manager session_manager;
+
+
+
</ins><span class="cx"> switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_t manage);
</span><span class="cx"> void switch_core_sqldb_stop(void);
</span><span class="cx"> void switch_core_session_init(switch_memory_pool_t *pool);
</span></span></pre></div>
<a id="freeswitchtrunksrcincludeswitch_coreh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/include/switch_core.h (16097 => 16098)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/include/switch_core.h        2009-12-30 20:45:37 UTC (rev 16097)
+++ freeswitch/trunk/src/include/switch_core.h        2009-12-30 20:55:04 UTC (rev 16098)
</span><span class="lines">@@ -1942,6 +1942,7 @@
</span><span class="cx"> #define switch_check_network_list_ip(_ip_str, _list_name) switch_check_network_list_ip_token(_ip_str, _list_name, NULL)
</span><span class="cx"> SWITCH_DECLARE(void) switch_time_set_monotonic(switch_bool_t enable);
</span><span class="cx"> SWITCH_DECLARE(void) switch_time_set_nanosleep(switch_bool_t enable);
</span><ins>+SWITCH_DECLARE(void) switch_time_set_matrix(switch_bool_t enable);
</ins><span class="cx"> SWITCH_DECLARE(void) switch_time_set_cond_yield(switch_bool_t enable);
</span><span class="cx"> SWITCH_DECLARE(uint32_t) switch_core_min_dtmf_duration(uint32_t duration);
</span><span class="cx"> SWITCH_DECLARE(uint32_t) switch_core_max_dtmf_duration(uint32_t duration);
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_corec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_core.c (16097 => 16098)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_core.c        2009-12-30 20:45:37 UTC (rev 16097)
+++ freeswitch/trunk/src/switch_core.c        2009-12-30 20:55:04 UTC (rev 16098)
</span><span class="lines">@@ -1415,6 +1415,8 @@
</span><span class="cx">                                         switch_time_set_nanosleep(switch_true(var));
</span><span class="cx">                                 } else if (!strcasecmp(var, &quot;enable-cond-yield&quot;)) {
</span><span class="cx">                                         switch_time_set_cond_yield(switch_true(var));
</span><ins>+                                } else if (!strcasecmp(var, &quot;enable-timer-matrix&quot;)) {
+                                        switch_time_set_matrix(switch_true(var));
</ins><span class="cx">                                 } else if (!strcasecmp(var, &quot;max-sessions&quot;) &amp;&amp; !zstr(val)) {
</span><span class="cx">                                         switch_core_session_limit(atoi(val));
</span><span class="cx">                                 } else if (!strcasecmp(var, &quot;rtp-start-port&quot;) &amp;&amp; !zstr(val)) {
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_core_sessionc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_core_session.c (16097 => 16098)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_core_session.c        2009-12-30 20:45:37 UTC (rev 16097)
+++ freeswitch/trunk/src/switch_core_session.c        2009-12-30 20:55:04 UTC (rev 16098)
</span><span class="lines">@@ -36,13 +36,7 @@
</span><span class="cx"> #include &quot;switch_core.h&quot;
</span><span class="cx"> #include &quot;private/switch_core_pvt.h&quot;
</span><span class="cx"> 
</span><del>-static struct {
-        switch_memory_pool_t *memory_pool;
-        switch_hash_t *session_table;
-        uint32_t session_count;
-        uint32_t session_limit;
-        switch_size_t session_id;
-} session_manager;
</del><ins>+struct switch_session_manager session_manager;
</ins><span class="cx"> 
</span><span class="cx"> #ifdef SWITCH_DEBUG_RWLOCKS
</span><span class="cx"> SWITCH_DECLARE(switch_core_session_t *) switch_core_session_perform_locate(const char *uuid_str, const char *file, const char *func, int line)
</span></span></pre></div>
<a id="freeswitchtrunksrcswitch_timec"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/switch_time.c (16097 => 16098)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/switch_time.c        2009-12-30 20:45:37 UTC (rev 16097)
+++ freeswitch/trunk/src/switch_time.c        2009-12-30 20:55:04 UTC (rev 16098)
</span><span class="lines">@@ -45,6 +45,32 @@
</span><span class="cx"> 
</span><span class="cx"> #define MAX_TICK UINT32_MAX - 1024
</span><span class="cx"> 
</span><ins>+#define MAX_ELEMENTS 3600
+#define IDLE_SPEED 100
+
+#if defined(HAVE_CLOCK_GETTIME) &amp;&amp; defined(CLOCK_MONOTONIC)
+static int MONO = 1;
+#else
+static int MONO = 0;
+#endif
+
+#if defined(HAVE_CLOCK_NANOSLEEP) 
+static int NANO = 1;
+#else
+static int NANO = 0;
+#endif
+
+
+static int OFFSET = 0;
+
+static int COND = 0;
+
+static int MATRIX = 1;
+
+static int STEP_MS = 10;
+static int STEP_MIC = 10000;
+static int TICK_PER_SEC = 100;
+
</ins><span class="cx"> static int MS_PER_TICK = 10;
</span><span class="cx"> 
</span><span class="cx"> static switch_memory_pool_t *module_pool = NULL;
</span><span class="lines">@@ -66,12 +92,6 @@
</span><span class="cx"> SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime);
</span><span class="cx"> SWITCH_MODULE_DEFINITION(CORE_SOFTTIMER_MODULE, softtimer_load, softtimer_shutdown, softtimer_runtime);
</span><span class="cx"> 
</span><del>-#define MAX_ELEMENTS 3600
-#define IDLE_SPEED 100
-#define STEP_MS 1
-#define STEP_MIC 1000
-#define TICK_PER_SEC 1000
-
</del><span class="cx"> struct timer_private {
</span><span class="cx">         switch_size_t reference;
</span><span class="cx">         switch_size_t start;
</span><span class="lines">@@ -92,6 +112,15 @@
</span><span class="cx"> 
</span><span class="cx"> static timer_matrix_t TIMER_MATRIX[MAX_ELEMENTS + 1];
</span><span class="cx"> 
</span><ins>+static void os_yield(void)
+{
+#if defined(WIN32)
+        SwitchToThread();
+#else
+        sched_yield();
+#endif
+}
+
</ins><span class="cx"> static void do_sleep(switch_interval_time_t t)
</span><span class="cx"> {
</span><span class="cx"> #if defined(HAVE_CLOCK_NANOSLEEP) || defined(DARWIN)
</span><span class="lines">@@ -105,16 +134,18 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if !defined(DARWIN)
</span><del>-        if (t &gt; 100000) {
</del><ins>+        if (t &gt; 100000 || !NANO) {
</ins><span class="cx">                 apr_sleep(t);
</span><ins>+                return;
</ins><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx">         
</span><del>-
</del><span class="cx"> #if defined(HAVE_CLOCK_NANOSLEEP)
</span><del>-        ts.tv_sec = t / APR_USEC_PER_SEC;
-        ts.tv_nsec = ((t % APR_USEC_PER_SEC) * 1000) - 1000000;
</del><ins>+        t -= OFFSET;
+        ts.tv_sec = t / 1000000;
+        ts.tv_nsec = ((t % 1000000) * 1000);
</ins><span class="cx">         clock_nanosleep(CLOCK_MONOTONIC, 0, &amp;ts, NULL);
</span><ins>+
</ins><span class="cx"> #elif defined(DARWIN)
</span><span class="cx">         ts.tv_sec = t / APR_USEC_PER_SEC;
</span><span class="cx">         ts.tv_nsec = (t % APR_USEC_PER_SEC) * 1000;
</span><span class="lines">@@ -129,6 +160,48 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static switch_interval_time_t average_time(switch_interval_time_t t, int reps)
+{
+        int x = 0;
+        switch_time_t start, stop, sum = 0;
+
+        for(x = 0; x &lt; reps; x++) {
+                start = switch_time_now();
+                do_sleep(t);
+                stop = switch_time_now();
+                sum += (stop - start);
+        }
+
+        return sum / reps;
+        
+}
+
+static void calibrate_clock(void)
+{
+        int x;
+        switch_interval_time_t avg, val = 1000, want = 1000;
+        int over = 0, under = 0, good = 0;
+
+        for (x = 0; x &lt; 500; x++) {
+                avg = average_time(val, 100);
+                
+                if (abs(want - avg) &lt;= 2) {
+                        if (++good &gt; 10) {
+                                break;
+                        }
+                } else if (avg &gt; want) {
+                        val--;
+                        over++;
+                } else if (avg &lt; want) {
+                        val++;
+                        under++;
+                }
+        }
+
+        OFFSET = want - val;
+}
+
+
</ins><span class="cx"> SWITCH_DECLARE(switch_time_t) switch_micro_time_now(void)
</span><span class="cx"> {
</span><span class="cx">         return (globals.RUNNING == 1 &amp;&amp; runtime.timestamp) ? runtime.timestamp : switch_time_now();
</span><span class="lines">@@ -144,33 +217,41 @@
</span><span class="cx">         return now;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if defined(HAVE_CLOCK_GETTIME) &amp;&amp; defined(CLOCK_MONOTONIC)
-static int MONO = 1;
-#else
-static int MONO = 0;
-#endif
-
-#if defined(HAVE_CLOCK_NANOSLEEP)
-static int NANO = 1;
-#else
-static int NANO = 0;
-#endif
-
-
</del><span class="cx"> SWITCH_DECLARE(void) switch_time_set_monotonic(switch_bool_t enable)
</span><span class="cx"> {
</span><span class="cx">         MONO = enable ? 1 : 0;
</span><span class="cx">         switch_time_sync();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+
+SWITCH_DECLARE(void) switch_time_set_matrix(switch_bool_t enable)
+{
+        MATRIX = enable ? 1 : 0;
+        if (MATRIX) {
+                STEP_MS = 1;
+                STEP_MIC = 1000;
+                TICK_PER_SEC = 1000;
+        } else {
+                STEP_MS = 10;
+                STEP_MIC = 10000;
+                TICK_PER_SEC = 100;
+        }
+        switch_time_sync();
+}
+
</ins><span class="cx"> SWITCH_DECLARE(void) switch_time_set_nanosleep(switch_bool_t enable)
</span><span class="cx"> {
</span><ins>+#if defined(HAVE_CLOCK_NANOSLEEP) 
</ins><span class="cx">         NANO = enable ? 1 : 0;
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> SWITCH_DECLARE(void) switch_time_set_cond_yield(switch_bool_t enable)
</span><span class="cx"> {
</span><del>-        globals.use_cond_yield = enable ? 1 : 0;
</del><ins>+        COND = enable ? 1 : 0;
+        if (COND) {
+                MATRIX = 1;
+        }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static switch_time_t time_now(int64_t offset)
</span><span class="lines">@@ -226,6 +307,11 @@
</span><span class="cx"> 
</span><span class="cx"> SWITCH_DECLARE(void) switch_cond_next(void)
</span><span class="cx"> {
</span><ins>+        if (session_manager.session_count &gt; 1000) {
+                os_yield();
+                return;
+        }
+
</ins><span class="cx"> #ifdef DISABLE_1MS_COND
</span><span class="cx">         do_sleep(1000);
</span><span class="cx"> #else
</span><span class="lines">@@ -291,6 +377,10 @@
</span><span class="cx"> 
</span><span class="cx">                 if (timer-&gt;interval &gt; 0 &amp;&amp; timer-&gt;interval &lt; MS_PER_TICK) {
</span><span class="cx">                         MS_PER_TICK = timer-&gt;interval;
</span><ins>+                        STEP_MS = 1;
+                        STEP_MIC = 1000;
+                        TICK_PER_SEC = 1000;
+                        switch_time_sync();
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 return SWITCH_STATUS_SUCCESS;
</span><span class="lines">@@ -366,33 +456,31 @@
</span><span class="cx">         }
</span><span class="cx">         timer_step(timer);
</span><span class="cx"> 
</span><ins>+        if (!MATRIX) {
+                do_sleep(1000 * timer-&gt;interval);
+                goto end;
+        }
+
</ins><span class="cx">         while (globals.RUNNING == 1 &amp;&amp; private_info-&gt;ready &amp;&amp; TIMER_MATRIX[timer-&gt;interval].tick &lt; private_info-&gt;reference) {
</span><span class="cx">                 check_roll();
</span><del>-                        
-                if (NANO) {
-                        do_sleep(1000 * timer-&gt;interval);
-                        continue;
-                }
-
</del><ins>+                
</ins><span class="cx">                 if (globals.use_cond_yield == 1) {
</span><del>-                        if (switch_mutex_lock(TIMER_MATRIX[cond_index].mutex) == SWITCH_STATUS_SUCCESS) {
-                                if (TIMER_MATRIX[timer-&gt;interval].tick &lt; private_info-&gt;reference) {
-                                        switch_thread_cond_wait(TIMER_MATRIX[cond_index].cond, TIMER_MATRIX[cond_index].mutex);        
-                                }
-                                switch_mutex_unlock(TIMER_MATRIX[cond_index].mutex);
</del><ins>+                        switch_mutex_lock(TIMER_MATRIX[cond_index].mutex);
+                        if (TIMER_MATRIX[timer-&gt;interval].tick &lt; private_info-&gt;reference) {
+                                switch_thread_cond_wait(TIMER_MATRIX[cond_index].cond, TIMER_MATRIX[cond_index].mutex);        
+                        }
+                        switch_mutex_unlock(TIMER_MATRIX[cond_index].mutex);
+                } else {
+                        if (session_manager.session_count &gt; 1000) {
+                                os_yield();
</ins><span class="cx">                         } else {
</span><span class="cx">                                 do_sleep(1000);
</span><span class="cx">                         }
</span><del>-                } else {
-                        do_sleep(1000);
</del><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (globals.RUNNING == 1) {
-                return SWITCH_STATUS_SUCCESS;
-        }
-
-        return SWITCH_STATUS_FALSE;
</del><ins>+ end:
+        return globals.RUNNING == 1 ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static switch_status_t timer_check(switch_timer_t *timer, switch_bool_t step)
</span><span class="lines">@@ -492,8 +580,12 @@
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        globals.use_cond_yield = globals.RUNNING = 1;
</del><ins>+        calibrate_clock();
+        switch_time_sync();
</ins><span class="cx">         
</span><ins>+        globals.use_cond_yield = COND;
+        globals.RUNNING = 1;
+        
</ins><span class="cx">         while (globals.RUNNING == 1) {
</span><span class="cx">                 runtime.reference += STEP_MIC;
</span><span class="cx">                 while ((ts = time_now(runtime.offset)) &lt; runtime.reference) {
</span><span class="lines">@@ -513,7 +605,13 @@
</span><span class="cx">                         } else {
</span><span class="cx">                                 rev_errs = 0;
</span><span class="cx">                         }
</span><del>-                        do_sleep(STEP_MIC);                
</del><ins>+
+                        if (session_manager.session_count &gt; 1000) {
+                                os_yield();
+                        } else {
+                                do_sleep(STEP_MIC);
+                        }
+
</ins><span class="cx">                         last = ts;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="lines">@@ -570,18 +668,18 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-                if ((current_ms % MS_PER_TICK) == 0) {
</del><ins>+                if (MATRIX &amp;&amp; (current_ms % MS_PER_TICK) == 0) {
</ins><span class="cx">                         for (x = MS_PER_TICK; x &lt;= MAX_ELEMENTS; x += MS_PER_TICK) {
</span><span class="cx">                                 if ((current_ms % x) == 0) {
</span><span class="cx">                                         if (TIMER_MATRIX[x].count) {
</span><span class="cx">                                                 TIMER_MATRIX[x].tick++;
</span><span class="cx"> #ifdef DISABLE_1MS_COND
</span><del>-                                                if (!NANO) {
-                                                        if (TIMER_MATRIX[x].mutex &amp;&amp; switch_mutex_trylock(TIMER_MATRIX[x].mutex) == SWITCH_STATUS_SUCCESS) {
-                                                                switch_thread_cond_broadcast(TIMER_MATRIX[x].cond);
-                                                                switch_mutex_unlock(TIMER_MATRIX[x].mutex);
-                                                        }
</del><ins>+                                                
+                                                if (TIMER_MATRIX[x].mutex &amp;&amp; switch_mutex_trylock(TIMER_MATRIX[x].mutex) == SWITCH_STATUS_SUCCESS) {
+                                                        switch_thread_cond_broadcast(TIMER_MATRIX[x].cond);
+                                                        switch_mutex_unlock(TIMER_MATRIX[x].mutex);
</ins><span class="cx">                                                 }
</span><ins>+                                                
</ins><span class="cx"> #endif
</span><span class="cx">                                                 if (TIMER_MATRIX[x].tick == MAX_TICK) {
</span><span class="cx">                                                         TIMER_MATRIX[x].tick = 0;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>