handle 0 timeout in RunLoop() correctly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -198,13 +198,19 @@ void wxSelectDispatcher::RunLoop(int timeout)
|
|||||||
fd_set writeset = m_writeset;
|
fd_set writeset = m_writeset;
|
||||||
fd_set exeptset = m_exeptset;
|
fd_set exeptset = m_exeptset;
|
||||||
wxStopWatch sw;
|
wxStopWatch sw;
|
||||||
if ( ptv )
|
if ( ptv && timeout )
|
||||||
sw.Start(ptv->tv_usec/10);
|
sw.Start(ptv->tv_usec/10);
|
||||||
ret = select(m_maxFD+1, &readset, &writeset, &exeptset, ptv);
|
ret = select(m_maxFD+1, &readset, &writeset, &exeptset, ptv);
|
||||||
switch ( ret )
|
switch ( ret )
|
||||||
{
|
{
|
||||||
// TODO: handle unix signals here
|
// TODO: handle unix signals here
|
||||||
case -1:
|
case -1:
|
||||||
|
if ( !timeout )
|
||||||
|
{
|
||||||
|
// it doesn't make sense to remain here
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ptv )
|
if ( ptv )
|
||||||
{
|
{
|
||||||
ptv->tv_sec = 0;
|
ptv->tv_sec = 0;
|
||||||
|
Reference in New Issue
Block a user