fix lots of BS

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@716 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2006-03-01 17:06:10 +00:00
parent 21d221a10f
commit 7665bf3e8e
7 changed files with 103 additions and 36 deletions

View File

@@ -162,6 +162,10 @@ static void *SWITCH_THREAD_FUNC switch_event_thread(switch_thread *thread, void
switch_event_deliver(&out_event);
}
}
if (THREAD_RUNNING < 0) {
THREAD_RUNNING--;
}
switch_yield(1000);
}
THREAD_RUNNING = 0;
@@ -230,10 +234,18 @@ SWITCH_DECLARE(switch_status) switch_event_reserve_subclass_detailed(char *owner
SWITCH_DECLARE(switch_status) switch_event_shutdown(void)
{
THREAD_RUNNING = -1;
int x = 0, last = 0;
while (THREAD_RUNNING) {
switch_yield(1000);
if (THREAD_RUNNING > 0) {
THREAD_RUNNING = -1;
while (x < 100 && THREAD_RUNNING) {
switch_yield(1000);
if (THREAD_RUNNING == last) {
x++;
}
last = THREAD_RUNNING;
}
}
return SWITCH_STATUS_SUCCESS;
}