mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-13 14:54:17 +00:00
FS-10084 [mod_v8] If the value passed is negative, block until event is received
This commit is contained in:
1 parent
ed3ce77b4e
commit
2fe107aca9
1 file changed
+4
@@ -336,6 +336,10 @@ JS_EVENTHANDLER_FUNCTION_IMPL(GetEvent)
|
||||
if (switch_queue_pop_timeout(_event_queue, &pop, (switch_interval_time_t) timeout * 1000) == SWITCH_STATUS_SUCCESS && pop) {
|
||||
pevent = (switch_event_t *) pop;
|
||||
}
|
||||
} else if (timeout < 0) {
|
||||
if (switch_queue_pop(_event_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
|
||||
prevent = (switch_event_t *) pop;
|
||||
}
|
||||
} else {
|
||||
if (switch_queue_trypop(_event_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
|
||||
pevent = (switch_event_t *) pop;
|
||||
|
||||
Reference in new issue
Block a user