VirtualBox

Changeset 1808 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 29, 2007 5:25:07 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
19990
Message:

this is how we setup a one-shot timer. (code still disabled)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/linux/server.cpp

    r1806 r1808  
    253253
    254254                /* Start a shutdown timer to provide some delay */
    255                 int vrc = RTTimerStart (sTimer, 0);
    256 /// @todo uncomment when implemented
    257 //                AssertRC (vrc);
     255#if 0 /** @todo Doesn't work when the 2nd client attaches while before the timer ticks. Dmitry will debug. */
     256                int vrc = RTTimerStart (sTimer, uint64_t (VBoxSVC_ShutdownDelay) * 1000000);
     257                AssertRC (vrc);
    258258                if (VBOX_FAILURE (vrc))
     259#endif
    259260                {
    260261                    /* failed to start the timer, post the shutdown event
     
    315316        NOREF (pvUser);
    316317
    317         if (pTimer)
    318         {
    319             /* it's a single shot timer */
    320             int vrc = RTTimerStop (pTimer);
    321 /// @todo uncomment when implemented
    322 //                AssertRC (vrc);
    323             NOREF (vrc);
    324         }
    325 
    326318        /* post a destruction event to the main thread to safely release the
    327319         * extra reference added in VirtualBoxClassFactory::GetInstance() */
     
    350342            return NS_ERROR_OUT_OF_MEMORY;
    351343
    352         int vrc = RTTimerCreateEx (&sTimer,
    353                                    uint64_t (VBoxSVC_ShutdownDelay) * 1000000,
    354                                    0, ShutdownTimer, NULL);
    355         NOREF (vrc);
    356 /// @todo uncomment when implemented
    357 //         if (VBOX_FAILURE (vrc))
    358 //         {
    359 //             LogFlowFunc (("Failed to create a timer! (vrc=%Vrc)\n", vrc));
    360 //             return NS_ERROR_FAILURE;
    361 //         }
     344        int vrc = RTTimerCreateEx (&sTimer, 0, 0, ShutdownTimer, NULL);
     345        if (VBOX_FAILURE (vrc))
     346        {
     347            LogFlowFunc (("Failed to create a timer! (vrc=%Vrc)\n", vrc));
     348            return NS_ERROR_FAILURE;
     349        }
    362350
    363351        return NS_OK;
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