MGR: If LOCKFILE doesn't already exist, core client isn't running so skip further testing

svn path=/trunk/boinc/; revision=18420
This commit is contained in:
Charlie Fenton 2009-06-15 22:33:07 +00:00
parent d4a43f05eb
commit 76b9af4153
2 changed files with 14 additions and 4 deletions

View File

@ -5666,3 +5666,11 @@ David 14 June 2009
html/user/
forum_get_data.php
Charlie 14 June 2009
- MGR: If LOCKFILE doesn't already exist, core client isn't running so skip
further testing. This avoids a very rare possible race condition and is
more efficient.
clientgui/
BOINCClientManager.cpp

View File

@ -144,11 +144,13 @@ bool CBOINCClientManager::IsBOINCCoreRunning() {
static FILE_LOCK file_lock;
sprintf(path, "%s/%s", (char *)wxGetApp().GetDataDirectory().char_str(), LOCK_FILE_NAME);
if (boinc_file_exists(path) { // If there is no lock file, core is not running
if (file_lock.lock(path)) {
running = true;
} else {
file_lock.unlock(path);
}
}
#endif
wxLogTrace(wxT("Function Status"), wxT("CBOINCClientManager::IsBOINCCoreRunning - Returning '%d'"), (int)running);
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCClientManager::IsBOINCCoreRunning - Function End"));