From 26abe0d1112a9e6539bca47f7b75dfcd5acd9c8d Mon Sep 17 00:00:00 2001 From: Josh Faust Date: Thu, 1 Jul 2010 03:40:46 +0000 Subject: [PATCH] gah... real fix for 100% CPU issue. not sure why my tests showed the previous fix working --- core/roscpp/src/libros/poll_set.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/roscpp/src/libros/poll_set.cpp b/core/roscpp/src/libros/poll_set.cpp index 8733f023..b952afec 100644 --- a/core/roscpp/src/libros/poll_set.cpp +++ b/core/roscpp/src/libros/poll_set.cpp @@ -235,13 +235,14 @@ void PollSet::update(int poll_timeout) // If these are registered events for this socket, OR the events are ERR/HUP/NVAL, // call through to the registered function + int revents = ufds_[i].revents; if (func - && ((events & ufds_[i].revents) - || (events & POLLERR) - || (events & POLLHUP) - || (events & POLLNVAL))) + && ((events & revents) + || (revents & POLLERR) + || (revents & POLLHUP) + || (revents & POLLNVAL))) { - func(ufds_[i].revents & events); + func(revents & (events|POLLERR|POLLHUP|POLLNVAL)); } ufds_[i].revents = 0;