From: Michael Jerris Date: Mon, 26 Apr 2010 05:13:10 +0000 (-0400) Subject: more efficient check X-Git-Tag: git2svn-syncpoint-master~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2ec65a10ae77d37095c77236bec8f1af95ff4c8;p=thirdparty%2Ffreeswitch.git more efficient check --- diff --git a/libs/esl/src/esl.c b/libs/esl/src/esl.c index 70c91a2d20..d2ca396546 100644 --- a/libs/esl/src/esl.c +++ b/libs/esl/src/esl.c @@ -786,7 +786,7 @@ ESL_DECLARE(esl_status_t) esl_recv_event_timed(esl_handle_t *handle, uint32_t ms return ESL_FAIL; } - if (esl_mutex_trylock(handle->mutex) != ESL_SUCCESS) { + if (activity == 0 || !FD_ISSET(handle->sock, &rfds) || (esl_mutex_trylock(handle->mutex) != ESL_SUCCESS)) { return ESL_BREAK; }