mirror of https://github.com/BOINC/boinc.git
MGR: Every 10 seconds, kill any running graphics apps whose associated worker tasks are no longer running
svn path=/trunk/boinc/; revision=13620
This commit is contained in:
parent
683a8bad08
commit
0b8b6d922f
|
@ -29,6 +29,7 @@
|
|||
#include "BOINCGUIApp.h"
|
||||
#include "BOINCBaseFrame.h"
|
||||
#include "MainDocument.h"
|
||||
#include <sys/wait.h>
|
||||
|
||||
#ifdef SANDBOX
|
||||
#include <grp.h>
|
||||
|
@ -397,6 +398,16 @@ int CMainDocument::OnPoll() {
|
|||
m_pNetworkConnection->Poll();
|
||||
}
|
||||
|
||||
// Every 10 seconds, kill any running graphics apps
|
||||
// whose associated worker tasks are no longer running
|
||||
wxDateTime timeNow = wxDateTime::Now();
|
||||
wxTimeSpan ts(timeNow - m_dtKillInactiveGfxTimestamp);
|
||||
if (ts.GetSeconds() > 10) {
|
||||
CachedResultsStatusUpdate();
|
||||
m_dtKillInactiveGfxTimestamp = timeNow;
|
||||
KillInactiveGraphicsApps();
|
||||
}
|
||||
|
||||
return iRetVal;
|
||||
}
|
||||
|
||||
|
@ -981,8 +992,8 @@ int CMainDocument::WorkResume(std::string& strProjectURL, std::string& strName)
|
|||
}
|
||||
|
||||
|
||||
// If the graphics application for the current task is already running,
|
||||
// return a pointer to its RUNNING_GFX_APP struct.
|
||||
// If the graphics application for the current task is already
|
||||
// running, return a pointer to its RUNNING_GFX_APP struct.
|
||||
RUNNING_GFX_APP* CMainDocument::GetRunningGraphicsApp(RESULT* result, int slot)
|
||||
{
|
||||
bool exited = false;
|
||||
|
@ -1026,6 +1037,7 @@ RUNNING_GFX_APP* CMainDocument::GetRunningGraphicsApp(RESULT* result, int slot)
|
|||
}
|
||||
|
||||
|
||||
// Kill any running graphics apps whose worker tasks aren't running
|
||||
void CMainDocument::KillInactiveGraphicsApps()
|
||||
{
|
||||
std::vector<RUNNING_GFX_APP>::iterator gfx_app_iter;
|
||||
|
|
|
@ -186,6 +186,7 @@ public:
|
|||
private:
|
||||
int CachedResultsStatusUpdate();
|
||||
wxDateTime m_dtResultsTimestamp;
|
||||
wxDateTime m_dtKillInactiveGfxTimestamp;
|
||||
std::vector<RUNNING_GFX_APP> m_running_gfx_apps;
|
||||
RUNNING_GFX_APP* GetRunningGraphicsApp(RESULT* result, int slot);
|
||||
void KillAllRunningGraphicsApps();
|
||||
|
|
Loading…
Reference in New Issue