VirtualBox

Ignore:
Timestamp:
Mar 13, 2015 8:10:31 AM (10 years ago)
Author:
vboxsync
Message:

VBoxNetDHCP/VBoxNetNAT: don't execute shutdown() twice

File:
1 edited

Legend:

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

    r54730 r54741  
    461461{
    462462    syncEnter();
    463     m->fShutdown = true;
    464     if (m->m_hThrRecv != NIL_RTTHREAD)
    465     {
    466         int rc = abortWait();
    467         AssertRC(rc == VINF_SUCCESS || rc == VERR_SEM_DESTROYED);
    468         rc = m->m_EventQ->interruptEventQueueProcessing();
    469         if (RT_SUCCESS(rc))
     463    if (!m->fShutdown)
     464    {
     465        m->fShutdown = true;
     466        if (m->m_hThrRecv != NIL_RTTHREAD)
    470467        {
    471             rc = RTThreadWait(m->m_hThrRecv, 60000, NULL);
    472             if (RT_FAILURE(rc))
    473                 LogWarningFunc(("RTThreadWait(%RTthrd) -> %Rrc\n", m->m_hThrRecv, rc));
    474         }
    475         else
    476         {
    477             AssertMsgFailed(("interruptEventQueueProcessing() failed\n"));
    478             RTThreadWait(m->m_hThrRecv , 0, NULL);
     468            int rc = abortWait();
     469            AssertRC(rc == VINF_SUCCESS || rc == VERR_SEM_DESTROYED);
     470            rc = m->m_EventQ->interruptEventQueueProcessing();
     471            if (RT_SUCCESS(rc))
     472            {
     473                rc = RTThreadWait(m->m_hThrRecv, 60000, NULL);
     474                if (RT_FAILURE(rc))
     475                    LogWarningFunc(("RTThreadWait(%RTthrd) -> %Rrc\n", m->m_hThrRecv, rc));
     476            }
     477            else
     478            {
     479                AssertMsgFailed(("interruptEventQueueProcessing() failed\n"));
     480                RTThreadWait(m->m_hThrRecv , 0, NULL);
     481            }
    479482        }
    480483    }
Note: See TracChangeset for help on using the changeset viewer.

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