mirror of https://github.com/BOINC/boinc.git
- VBOX: Add the ability for the wrapper to know if vboxmanage has hung or is stuck
in a loop. If so, terminate the process and return an error to the calling function. samples/vboxwrapper/ vbox.cpp svn path=/trunk/boinc/; revision=24767
This commit is contained in:
parent
4e54344742
commit
a635b075ef
|
@ -8919,3 +8919,11 @@ Rom 9 Dec 2011
|
|||
|
||||
samples/vboxwrapper/
|
||||
vbox.cpp
|
||||
|
||||
Rom 9 Dec 2011
|
||||
- VBOX: Add the ability for the wrapper to know if vboxmanage has hung or is stuck
|
||||
in a loop. If so, terminate the process and return an error to the calling
|
||||
function.
|
||||
|
||||
samples/vboxwrapper/
|
||||
vbox.cpp
|
||||
|
|
|
@ -116,6 +116,7 @@ int VBOX_VM::vbm_popen(string& arguments, string& output, const char* item) {
|
|||
void* pBuf = NULL;
|
||||
DWORD dwCount = 0;
|
||||
unsigned long ulExitCode = 0;
|
||||
unsigned long ulExitTimeout = 0;
|
||||
|
||||
memset(&si, 0, sizeof(si));
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
|
@ -178,7 +179,20 @@ int VBOX_VM::vbm_popen(string& arguments, string& output, const char* item) {
|
|||
}
|
||||
|
||||
if (ulExitCode != STILL_ACTIVE) break;
|
||||
Sleep(100);
|
||||
|
||||
// Timeout?
|
||||
if (ulExitTimeout >= 60000) {
|
||||
fprintf(
|
||||
stderr,
|
||||
"%s Process Timeout!.\n",
|
||||
boinc_msg_prefix(buf, sizeof(buf))
|
||||
);
|
||||
|
||||
TerminateProcess(pi.hProcess, EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Sleep(250);
|
||||
ulExitTimeout += 250;
|
||||
}
|
||||
|
||||
CLEANUP:
|
||||
|
|
Loading…
Reference in New Issue