File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 9
9
10
10
void DetectShutdownThread (boost::thread_group* threadGroup)
11
11
{
12
- bool shutdown = ShutdownRequested ();
12
+ bool fShutdown = ShutdownRequested ();
13
13
// Tell the main threads to shutdown.
14
- while (!shutdown )
14
+ while (!fShutdown )
15
15
{
16
16
MilliSleep (200 );
17
- shutdown = ShutdownRequested ();
17
+ fShutdown = ShutdownRequested ();
18
18
}
19
19
if (threadGroup)
20
+ {
20
21
threadGroup->interrupt_all ();
22
+ threadGroup->join_all ();
23
+ }
21
24
}
22
25
23
26
// ////////////////////////////////////////////////////////////////////////////
@@ -107,10 +110,16 @@ bool AppInit(int argc, char* argv[])
107
110
} catch (...) {
108
111
PrintExceptionContinue (NULL , " AppInit()" );
109
112
}
110
- if (!fRet ) {
113
+
114
+ if (!fRet )
115
+ {
111
116
if (detectShutdownThread)
112
117
detectShutdownThread->interrupt ();
118
+
113
119
threadGroup.interrupt_all ();
120
+ // threadGroup.join_all(); was left out intentionally here, because we didn't re-test all of
121
+ // the startup-failure cases to make sure they don't result in a hang due to some
122
+ // thread-blocking-waiting-for-another-thread-during-startup case
114
123
}
115
124
116
125
if (detectShutdownThread)
You can’t perform that action at this time.
0 commit comments