]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Apr 2006 19:29:56 +0000 (19:29 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 26 Apr 2006 19:29:56 +0000 (19:29 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1265 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core.c
src/switch_event.c

index 81e0a5355bee48f38a8e5874636ed80d99b8632b..dc25e69f3fa5fa4b1f9a2158dca317551df6e4aa 100644 (file)
@@ -2359,13 +2359,14 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread *thread, vo
        uint32_t itterations = 0;
        uint8_t trans = 0;
        switch_time_t last_commit = switch_time_now();
-       uint32_t work = 0, freq = 1000, target = 500, diff = 0;
+       uint32_t freq = 1000, target = 500, diff = 0;
        
-
        runtime.event_db = switch_core_db_handle();
        switch_queue_create(&runtime.sql_queue, SWITCH_SQL_QUEUE_LEN, runtime.memory_pool);
        
        for(;;) {
+               uint32_t work = 0;
+
                if (switch_queue_trypop(runtime.sql_queue, &pop) == SWITCH_STATUS_SUCCESS) {
                        char *sql = (char *) pop;
 
index e169c5456d4d02d83619d875e082dea4ba688bfd..7cb50e675e6739fe1e68e0d3d4b0756a9ff5a3cd 100644 (file)
@@ -172,10 +172,10 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread *thread, void
                any = len[1] + len[2] + len[0];
 
                if (!any) {
-                       switch_yield(1000);
                        if (THREAD_RUNNING != 1) {
                                break;
                        }
+                       switch_yield(1000);
                        continue;
                }
 
@@ -197,6 +197,8 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread *thread, void
                        THREAD_RUNNING--;
                }
        }
+
+
        THREAD_RUNNING = 0;
        return NULL;
 }