VirtualBox

Changeset 53502 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 10, 2014 5:02:39 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
97239
Message:

NetworkServices: no need to poll here

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.cpp

    r50213 r53502  
    458458    syncEnter();
    459459    m->fShutdown = true;
     460    if (m->m_hThrRecv != NIL_RTTHREAD)
     461    {
     462        int rc = m->m_EventQ->interruptEventQueueProcessing();
     463        if (RT_SUCCESS(rc))
     464        {
     465            rc = RTThreadWait(m->m_hThrRecv, 60000, NULL);
     466            if (RT_FAILURE(rc))
     467                LogWarningFunc(("RTThreadWait(%RTthrd) -> %Rrc\n", m->m_hThrRecv, rc));
     468        }
     469        else
     470        {
     471            AssertMsgFailed(("interruptEventQueueProcessing() failed\n"));
     472            RTThreadWait(m->m_hThrRecv , 0, NULL);
     473        }
     474    }
    460475    syncLeave();
    461476}
     
    735750                            0, /* flags, @todo: waitable ?*/
    736751                            "RECV");
    737     AssertRCReturn(rc,rc);
     752    AssertRCReturn(rc, rc);
    738753
    739754    m->m_EventQ = com::NativeEventQueue::getMainEventQueue();
    740755    AssertPtrReturn(m->m_EventQ, VERR_INTERNAL_ERROR);
    741756
    742     while(true)
    743     {
    744         m->m_EventQ->processEventQueue(0);
    745 
    746         if (m->fShutdown)
     757    while (!m->fShutdown)
     758    {
     759        rc = m->m_EventQ->processEventQueue(RT_INDEFINITE_WAIT);
     760        if (rc == VERR_INTERRUPTED)
     761        {
     762            LogFlow(("Event queue processing ended with rc=%Rrc\n", rc));
    747763            break;
    748 
    749         m->m_EventQ->processEventQueue(500);
     764        }
    750765    }
    751766
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette