Changeset 31872 in vbox for trunk/src/VBox/Main/xpcom
- Timestamp:
- Aug 23, 2010 4:07:41 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 65080
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xpcom/server.cpp
r30856 r31872 210 210 static bool gAutoShutdown = false; 211 211 212 static nsIEventQueue *gEventQ = nsnull; 213 static PRBool volatile gKeepRunning = PR_TRUE; 212 static nsIEventQueue *gEventQ = nsnull; 213 static PRBool volatile gKeepRunning = PR_TRUE; 214 static PRBool volatile gAllowSigUsrQuit = PR_TRUE; 214 215 215 216 ///////////////////////////////////////////////////////////////////////////// … … 335 336 Assert(onMainThread); 336 337 } 338 339 gAllowSigUsrQuit = PR_TRUE; 337 340 338 341 if (!timerStarted) … … 533 536 /* On success, make sure the previous timer is stopped to 534 537 * cancel a scheduled server termination (if any). */ 538 gAllowSigUsrQuit = PR_FALSE; 535 539 RTTimerLRStop(sTimer); 536 540 } … … 552 556 553 557 /* make sure the previous timer is stopped */ 558 gAllowSigUsrQuit = PR_FALSE; 554 559 RTTimerLRStop(sTimer); 555 560 } … … 729 734 }; 730 735 731 static void signal_handler(int /* sig */)736 static void signal_handler(int sig) 732 737 { 733 738 if (gEventQ && gKeepRunning) 734 739 { 735 /* post a quit event to the queue */ 736 ForceQuitEvent *ev = new ForceQuitEvent(); 737 ev->postTo(gEventQ); 740 if (sig == SIGUSR1) 741 { 742 if (gAllowSigUsrQuit) 743 { 744 VirtualBoxClassFactory::MaybeQuitEvent *ev = new VirtualBoxClassFactory::MaybeQuitEvent(); 745 ev->postTo(gEventQ); 746 } 747 /* else do nothing */ 748 } 749 else 750 { 751 /* post a force quit event to the queue */ 752 ForceQuitEvent *ev = new ForceQuitEvent(); 753 ev->postTo(gEventQ); 754 } 738 755 } 739 756 } … … 1030 1047 sigaction(SIGTERM, &sa, NULL); 1031 1048 sigaction(SIGTRAP, &sa, NULL); 1049 sigaction(SIGUSR1, &sa, NULL); 1032 1050 } 1033 1051
Note:
See TracChangeset
for help on using the changeset viewer.