diff --git a/checkin_notes b/checkin_notes index 18f6ac83f0..9efa8b1e9c 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/clientgui/BOINCClientManager.cpp b/clientgui/BOINCClientManager.cpp index 1beed6749f..dddde9bf93 100644 --- a/clientgui/BOINCClientManager.cpp +++ b/clientgui/BOINCClientManager.cpp @@ -144,10 +144,12 @@ bool CBOINCClientManager::IsBOINCCoreRunning() { static FILE_LOCK file_lock; sprintf(path, "%s/%s", (char *)wxGetApp().GetDataDirectory().char_str(), LOCK_FILE_NAME); - if (file_lock.lock(path)) { - running = true; - } else { - file_lock.unlock(path); + 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);