made Dispatch() return bool indicating whether we processed any events inside it or if the timeout expired

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-10-16 12:31:30 +00:00
parent c139dda12a
commit 5a557d1ea0
4 changed files with 29 additions and 10 deletions

View File

@@ -158,7 +158,7 @@ bool wxEpollDispatcher::UnregisterFD(int fd)
return true;
}
void wxEpollDispatcher::Dispatch(int timeout)
bool wxEpollDispatcher::Dispatch(int timeout)
{
epoll_event events[16];
@@ -176,10 +176,11 @@ void wxEpollDispatcher::Dispatch(int timeout)
{
wxLogSysError(_("Waiting for IO on epoll descriptor %d failed"),
m_epollDescriptor);
return;
return false;
}
}
bool gotEvents = false;
for ( epoll_event *p = events; p < events + e_num; p++ )
{
wxFDIOHandler * const handler = (wxFDIOHandler *)(p->data.ptr);
@@ -199,7 +200,13 @@ void wxEpollDispatcher::Dispatch(int timeout)
handler->OnWriteWaiting();
else if ( p->events & EPOLLERR )
handler->OnExceptionWaiting();
else
continue;
gotEvents = true;
}
return gotEvents;
}
#endif // wxUSE_EPOLL_DISPATCHER