add some more thread joins to avoid races

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12348 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-03-02 15:45:00 +00:00
parent 5f0c242265
commit 5d6fe797d1
2 changed files with 10 additions and 5 deletions

View File

@@ -113,7 +113,7 @@ static void do_sleep(switch_interval_time_t t)
SWITCH_DECLARE(switch_time_t) switch_micro_time_now(void)
{
return runtime.timestamp ? runtime.timestamp : switch_time_now();
return (globals.RUNNING == 1 && runtime.timestamp) ? runtime.timestamp : switch_time_now();
}
@@ -195,7 +195,7 @@ SWITCH_DECLARE(void) switch_cond_next(void)
#ifdef DISABLE_1MS_COND
do_sleep(1000);
#else
if (!runtime.timestamp || globals.use_cond_yield != 1) {
if (globals.RUNNING != 1 || !runtime.timestamp || globals.use_cond_yield != 1) {
do_sleep(1000);
return;
}
@@ -210,7 +210,7 @@ SWITCH_DECLARE(void) switch_cond_yield(switch_interval_time_t t)
switch_time_t want;
if (!t) return;
if (!runtime.timestamp || globals.use_cond_yield != 1) {
if (globals.RUNNING != 1 || !runtime.timestamp || globals.use_cond_yield != 1) {
do_sleep(t);
return;
}