Merge pull request #695 in FS/freeswitch from bugfix/FS-8726-spurious-case-of-thread-stuck-and to master

* commit '49462bfe00b1e3e7083093d00421f41a207eea92':
  FS-8726 #resolve [Spurious case of thread stuck and saturating CPU]
This commit is contained in:
Anthony Minessale II 2016-02-03 11:11:18 -06:00
commit 993c6e85aa
1 changed files with 3 additions and 1 deletions

View File

@ -1014,7 +1014,9 @@ SWITCH_DECLARE(switch_status_t) switch_poll(switch_pollfd_t *aprset, int32_t num
if (aprset) { if (aprset) {
st = apr_poll((apr_pollfd_t *) aprset, numsock, nsds, timeout); st = apr_poll((apr_pollfd_t *) aprset, numsock, nsds, timeout);
if (st == APR_TIMEUP) { if (numsock == 1 && ((aprset[0].rtnevents & APR_POLLERR) || (aprset[0].rtnevents & APR_POLLHUP) || (aprset[0].rtnevents & APR_POLLNVAL))) {
st = SWITCH_STATUS_GENERR;
} else if (st == APR_TIMEUP) {
st = SWITCH_STATUS_TIMEOUT; st = SWITCH_STATUS_TIMEOUT;
} }
} }