From a657bf9186883669f2d48effcf450f91bf9b042a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 12 Sep 2008 18:04:58 +0000 Subject: [PATCH] fix FSCORE-188 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9545 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_event.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/switch_event.c b/src/switch_event.c index 33597373f6..3c14aa0282 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -34,7 +34,7 @@ #include #include -#define MAX_DISPATCH 20 + #define DISPATCH_QUEUE_LEN 5000 //#define DEBUG_DISPATCH_QUEUES @@ -61,7 +61,9 @@ struct switch_event_subclass { char *name; }; -static int SOFT_MAX_DISPATCH = 0; +#define MAX_DISPATCH_VAL 20 +static unsigned int MAX_DISPATCH = MAX_DISPATCH_VAL; +static unsigned int SOFT_MAX_DISPATCH = 0; static char hostname[128] = ""; static char guess_ip_v4[80] = ""; static char guess_ip_v6[80] = ""; @@ -73,7 +75,7 @@ static switch_memory_pool_t *RUNTIME_POOL = NULL; static switch_memory_pool_t *THRUNTIME_POOL = NULL; #define NUMBER_OF_QUEUES 3 static switch_queue_t *EVENT_QUEUE[NUMBER_OF_QUEUES] = { 0 }; -static switch_queue_t *EVENT_DISPATCH_QUEUE[MAX_DISPATCH] = { 0 }; +static switch_queue_t *EVENT_DISPATCH_QUEUE[MAX_DISPATCH_VAL] = { 0 }; static int POOL_COUNT_MAX = SWITCH_CORE_QUEUE_LEN; static switch_mutex_t *EVENT_QUEUE_MUTEX = NULL; static switch_hash_t *CUSTOM_HASH = NULL; @@ -416,7 +418,8 @@ SWITCH_DECLARE(void) switch_core_memory_reclaim_events(void) SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void) { - int x = 0, last = 0; + uint32_t x = 0; + int last = 0; switch_hash_index_t *hi; const void *var; void *val; @@ -463,7 +466,7 @@ static void launch_dispatch_threads(int max, int len, switch_memory_pool_t *pool { switch_thread_t *thread; switch_threadattr_t *thd_attr; - int index = 0; + uint32_t index = 0; if (max > MAX_DISPATCH) { return;