VirtualBox

Changeset 88989 in vbox for trunk


Ignore:
Timestamp:
May 11, 2021 10:12:36 PM (4 years ago)
Author:
vboxsync
Message:

FE/VBoxHeadless: Make the main even loop a bit more prominent.
Report if we exit it b/c of an error (other than intentional
interruptEventQueueProcessing). bugref:8161

File:
1 edited

Legend:

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

    r88988 r88989  
    3636#include <iprt/ctype.h>
    3737#include <iprt/initterm.h>
     38#include <iprt/message.h>
    3839#include <iprt/path.h>
    3940#include <iprt/stream.h>
     
    14591460        Log(("VBoxHeadless: Waiting for PowerDown...\n"));
    14601461
    1461         while (   !g_fTerminateFE
    1462                && RT_SUCCESS(gEventQ->processEventQueue(RT_INDEFINITE_WAIT)))
    1463             /* nothing */ ;
     1462        /*
     1463         * Pump vbox events forever
     1464         */
     1465        for (;;)
     1466        {
     1467            int irc = gEventQ->processEventQueue(RT_INDEFINITE_WAIT);
     1468
     1469            /*
     1470             * interruptEventQueueProcessing from another thread is
     1471             * reported as VERR_INTERRUPTED, so check the flag first.
     1472             */
     1473            if (g_fTerminateFE)
     1474            {
     1475                break;
     1476            }
     1477
     1478            if (RT_FAILURE(irc))
     1479            {
     1480                RTMsgError("event loop: %Rrc", irc);
     1481                break;
     1482            }
     1483        }
    14641484
    14651485        Log(("VBoxHeadless: event loop has terminated...\n"));
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