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,6 +321,8 @@ void *CScreensaver::DataManagementProc() {
m_QuitDataManagementProc = true; m_QuitDataManagementProc = true;
} }
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_QuitDataManagementProc) { // If main thread has requested we exit
if (m_hGraphicsApplication || graphics_app_result_ptr) { if (m_hGraphicsApplication || graphics_app_result_ptr) {
terminate_screensaver(m_hGraphicsApplication, graphics_app_result_ptr); terminate_screensaver(m_hGraphicsApplication, graphics_app_result_ptr);
@ -331,8 +333,8 @@ void *CScreensaver::DataManagementProc() {
} }
return 0; // Exit the thread return 0; // Exit the thread
} }
boinc_sleep(0.25);
boinc_sleep(0.5); }
if (m_bResetCoreState) { if (m_bResetCoreState) {
// Try and get the current state of the CC // Try and get the current state of the CC
@ -348,28 +350,9 @@ void *CScreensaver::DataManagementProc() {
BOINCTRACE(_T("CScreensaver::DataManagementProc - ErrorMode = '%d', ErrorCode = '%x'\n"), m_bErrorMode, m_hrError); 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; m_updating_results = true;
retval = rpc->get_screensaver_tasks(suspend_reason, results); retval = rpc->get_screensaver_tasks(suspend_reason, results);
m_updating_results = false; m_updating_results = false;
boinc_sleep(0.25);
if (retval) { if (retval) {
// rpc call returned error // rpc call returned error
HandleRPCError(); HandleRPCError();