Code cleanup

svn path=/trunk/boinc/; revision=13812
This commit is contained in:
Charlie Fenton 2007-10-09 13:54:26 +00:00
parent d3ec7aa757
commit 1d4a1ad147
1 changed files with 12 additions and 29 deletions

View File

@ -321,19 +321,21 @@ void *CScreensaver::DataManagementProc() {
m_QuitDataManagementProc = true;
}
if (m_QuitDataManagementProc) { // If main thread has requested we exit
if (m_hGraphicsApplication || graphics_app_result_ptr) {
terminate_screensaver(m_hGraphicsApplication, graphics_app_result_ptr);
graphics_app_result_ptr = NULL;
m_hGraphicsApplication = 0;
graphics_app_result_ptr = NULL;
previous_result_ptr = NULL;
for (int i = 0; i < 4; i++) {
// Check for exit request 4 times per second
if (m_QuitDataManagementProc) { // If main thread has requested we exit
if (m_hGraphicsApplication || graphics_app_result_ptr) {
terminate_screensaver(m_hGraphicsApplication, graphics_app_result_ptr);
graphics_app_result_ptr = NULL;
m_hGraphicsApplication = 0;
graphics_app_result_ptr = NULL;
previous_result_ptr = NULL;
}
return 0; // Exit the thread
}
return 0; // Exit the thread
boinc_sleep(0.25);
}
boinc_sleep(0.5);
if (m_bResetCoreState) {
// Try and get the current state of the CC
retval = rpc->get_state(state);
@ -348,28 +350,9 @@ void *CScreensaver::DataManagementProc() {
BOINCTRACE(_T("CScreensaver::DataManagementProc - ErrorMode = '%d', ErrorCode = '%x'\n"), m_bErrorMode, m_hrError);
if ((m_dwBlankScreen) && (time(0) > m_dwBlankTime)) {
SetError(FALSE, SCRAPPERR_SCREENSAVERBLANKED);
m_QuitDataManagementProc = true;
}
if (m_QuitDataManagementProc) { // If main thread has requested we exit
if (m_hGraphicsApplication || graphics_app_result_ptr) {
terminate_screensaver(m_hGraphicsApplication, graphics_app_result_ptr);
graphics_app_result_ptr = NULL;
m_hGraphicsApplication = 0;
graphics_app_result_ptr = NULL;
previous_result_ptr = NULL;
}
return 0; // Exit the thread
}
boinc_sleep(0.25);
m_updating_results = true;
retval = rpc->get_screensaver_tasks(suspend_reason, results);
m_updating_results = false;
boinc_sleep(0.25);
if (retval) {
// rpc call returned error
HandleRPCError();