Changeset 39459 in vbox for trunk/src/VBox
- Timestamp:
- Nov 29, 2011 2:12:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/xpcom/server.cpp
r38636 r39459 226 226 //////////////////////////////////////////////////////////////////////////////// 227 227 228 enum229 {230 /* Delay before shutting down the VirtualBox server after the last231 * VirtualBox instance is released, in ms */232 VBoxSVC_ShutdownDelay = 5000233 };234 235 228 static bool gAutoShutdown = false; 229 /** Delay before shutting down the VirtualBox server after the last 230 * VirtualBox instance is released, in ms */ 231 static uint32_t gShutdownDelayMs = 5000; 236 232 237 233 static nsIEventQueue *gEventQ = nsnull; … … 344 340 { 345 341 LogFlowFunc(("Last VirtualBox instance was released.\n")); 346 LogFlowFunc(("Scheduling server shutdown in % dms...\n",347 VBoxSVC_ShutdownDelay));342 LogFlowFunc(("Scheduling server shutdown in %u ms...\n", 343 gShutdownDelayMs)); 348 344 349 345 /* make sure the previous timer (if any) is stopped; … … 351 347 RTTimerLRStop(sTimer); 352 348 353 int vrc = RTTimerLRStart(sTimer, uint64_t(VBoxSVC_ShutdownDelay) * 1000000);349 int vrc = RTTimerLRStart(sTimer, gShutdownDelayMs * RT_NS_1MS_64); 354 350 AssertRC(vrc); 355 351 timerStarted = SUCCEEDED(vrc); … … 405 401 void *handler() 406 402 { 407 LogFlowFunc (("\n"));403 LogFlowFuncEnter(); 408 404 409 405 Assert(RTCritSectIsInitialized(&sLock)); … … 432 428 gKeepRunning = PR_FALSE; 433 429 } 430 else 431 LogFlowFunc(("No automatic shutdown.\n")); 434 432 } 435 433 else … … 443 441 RTCritSectLeave(&sLock); 444 442 443 LogFlowFuncLeave(); 445 444 return NULL; 446 445 } … … 798 797 { "--auto-shutdown", 'A', RTGETOPT_REQ_NOTHING }, 799 798 { "--daemonize", 'd', RTGETOPT_REQ_NOTHING }, 800 { "--pidfile", 'p', RTGETOPT_REQ_STRING }, 799 { "--shutdown-delay", 'D', RTGETOPT_REQ_UINT32 }, 800 { "--pidfile", 'p', RTGETOPT_REQ_STRING }, 801 801 { "--logfile", 'F', RTGETOPT_REQ_STRING }, 802 802 { "--logrotate", 'R', RTGETOPT_REQ_UINT32 }, … … 822 822 { 823 823 case 'a': 824 {825 824 /* --automate mode means we are started by XPCOM on 826 825 * demand. Daemonize ourselves and activate … … 829 828 fDaemonize = true; 830 829 break; 831 } 832 833 /* --auto-shutdown mode means we're already daemonized. */ 830 834 831 case 'A': 835 {832 /* --auto-shutdown mode means we're already daemonized. */ 836 833 gAutoShutdown = true; 837 834 break; 838 }839 835 840 836 case 'd': 841 {842 837 fDaemonize = true; 843 838 break; 844 } 839 840 case 'D': 841 gShutdownDelayMs = ValueUnion.u32; 842 break; 845 843 846 844 case 'p': 847 {848 845 g_pszPidFile = ValueUnion.psz; 849 846 break; 850 }851 847 852 848 case 'F': … … 867 863 868 864 case 'h': 869 {870 865 RTPrintf("no help\n"); 871 866 return 1; 872 }873 867 874 868 case 'V': 875 {876 869 RTPrintf("%sr%s\n", RTBldCfgVersion(), RTBldCfgRevisionStr()); 877 870 return 0; 878 }879 871 880 872 default:
Note:
See TracChangeset
for help on using the changeset viewer.