VirtualBox

Changeset 31262 in vbox


Ignore:
Timestamp:
Jul 31, 2010 8:49:57 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64285
Message:

VBoxHeadless.cpp: Revised fix: Don't use WaitForCompletion() at all, just poll IProgress::Completed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp

    r31260 r31262  
    10751075        CHECK_ERROR_BREAK(console, PowerUp(progress.asOutParam()));
    10761076
    1077         /* wait for result because there can be errors */
    1078         /** @todo The error handling here is kind of peculiar, anyone care
    1079          *        to comment why this works just fine? */
     1077        /*
     1078         * Wait for the result because there can be errors.
     1079         *
     1080         * It's vital to process events while waiting (teleportation deadlocks),
     1081         * so we'll poll for the completion instead of waiting on it.
     1082         */
    10801083        for (;;)
    10811084        {
    1082             rc = progress->WaitForCompletion(500);
    1083             if (FAILED(rc))
    1084                 break;
    1085 
    1086             /* Processing events is vital for teleportation targets. */
    1087             gEventQ->processEventQueue(0);
    1088 
    10891085            BOOL fCompleted;
    10901086            rc = progress->COMGETTER(Completed)(&fCompleted);
    10911087            if (FAILED(rc) || fCompleted)
    10921088                break;
    1093         }
    1094 
     1089
     1090            /* Process pending events, then wait for new ones. */
     1091            gEventQ->processEventQueue(0);
     1092            gEventQ->processEventQueue(500);
     1093        }
     1094
     1095        /** @todo The error handling here is kind of peculiar, anyone care
     1096         *        to comment why this works just fine? (this is old the code) */
    10951097        if (SUCCEEDED(progress->WaitForCompletion(-1)))
    10961098        {
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