fix some contention issues under really high load...That doesn't mean you need to push it this hard and bug me about it =p

This commit is contained in:
Anthony Minessale committed 2012-11-07 12:10:50 -06:00
1 parent feb38cece2
commit f60962ae87
7 files changed
+89 -78

No files matched your search

+20
View File
@@ -6498,6 +6498,9 @@ switch_bool_t sofia_glue_execute_sql_callback(sofia_profile_t *profile,
switch_cache_db_release_db_handle(&dbh);
sofia_glue_fire_events(profile);
return ret;
}
@@ -7139,6 +7142,23 @@ char *sofia_glue_get_host(const char *str, switch_memory_pool_t *pool)
return s;
}
void sofia_glue_fire_events(sofia_profile_t *profile)
{
void *pop = NULL;
while (profile->event_queue && switch_queue_trypop(profile->event_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
switch_event_t *event = (switch_event_t *) pop;
switch_event_fire(&event);
}
}
void sofia_event_fire(sofia_profile_t *profile, switch_event_t **event)
{
switch_queue_push(profile->event_queue, *event);
*event = NULL;
}
/* For Emacs:
* Local Variables: