Mgr: When launching Mac client as a daemon, allow time for it to start

svn path=/trunk/boinc/; revision=25027
This commit is contained in:
Charlie Fenton 2012-01-11 11:33:03 +00:00
parent f5c434fc49
commit 5273a32b68
2 changed files with 13 additions and 1 deletions

View File

@ -360,3 +360,9 @@ David 10 Jan 2012
clientgui/
ViewResources.cpp
Charlie 11 Jan 2012
- Mgr: When launching Mac client as a daemon, allow time for it to start.
clientgui/
BOINCClientManager.cpp

View File

@ -296,7 +296,13 @@ bool CBOINCClientManager::StartupBOINCCore() {
if (IsBOINCConfiguredAsDaemon() == NewStyleDaemon) {
system ("launchctl load /Library/LaunchDaemons/edu.berkeley.boinc.plist");
system ("launchctl start edu.berkeley.boinc");
bReturnValue = IsBOINCCoreRunning();
for (int i=0; i<100; i++) { // Wait up to 1 seccond in 10 ms increments
boinc_sleep(0.01);
if (IsBOINCCoreRunning()) {
bReturnValue = true;
break;
}
}
} else {
// Get the full path to core client inside this application's bundle