mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 16:39:14 +00:00
add warnings
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12844 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
d5cf0c933f
commit
5b42ca0a6d
@ -1100,7 +1100,8 @@ SWITCH_DECLARE(void) switch_event_prep_for_delivery_detailed(const char *file, c
|
|||||||
SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, const char *func, int line, switch_event_t **event, void *user_data)
|
SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, const char *func, int line, switch_event_t **event, void *user_data)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
int index;
|
||||||
|
|
||||||
switch_assert(BLOCK != NULL);
|
switch_assert(BLOCK != NULL);
|
||||||
switch_assert(RUNTIME_POOL != NULL);
|
switch_assert(RUNTIME_POOL != NULL);
|
||||||
switch_assert(EVENT_QUEUE_MUTEX != NULL);
|
switch_assert(EVENT_QUEUE_MUTEX != NULL);
|
||||||
@ -1116,8 +1117,22 @@ SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(const char *file, con
|
|||||||
(*event)->event_user_data = user_data;
|
(*event)->event_user_data = user_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
|
for (index = (*event)->priority; index < 3; index++) {
|
||||||
|
if (switch_queue_trypush(EVENT_QUEUE[index], *event) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
if (index != (*event)->priority) {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "queued event at a lower priority!\n");
|
||||||
|
}
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Event queue is full!\n");
|
||||||
|
switch_yield(100000);
|
||||||
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
|
|
||||||
switch_queue_push(EVENT_QUEUE[(*event)->priority], *event);
|
|
||||||
*event = NULL;
|
*event = NULL;
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user