client: Fix a race condition on system reboot when using a child process for detecting GPUs, add debugging support to child process.

This commit is contained in:
Charlie Fenton 2013-07-12 18:35:47 -07:00
parent 9430638e36
commit 1d590434ea
2 changed files with 19 additions and 1 deletions

View File

@ -437,6 +437,10 @@ int COPROCS::launch_child_process_to_detect_gpus() {
int retval = 0;
boinc_delete_file(COPROC_INFO_FILENAME);
for (i=0; i<300; ++i) {
if (!boinc_file_exists(COPROC_INFO_FILENAME)) break;
boinc_sleep(0.01);
}
boinc_getcwd(dataDir);
@ -502,7 +506,10 @@ int COPROCS::launch_child_process_to_detect_gpus() {
}
for (i=0; i<300; ++i) {
if (!process_exists(prog)) break;
if (boinc_file_exists(COPROC_INFO_FILENAME) &&
!process_exists(prog)) {
break;
}
boinc_sleep(0.01);
}

View File

@ -261,6 +261,17 @@ static void do_gpu_detection(int argc, char** argv) {
boinc_install_signal_handlers();
gstate.parse_cmdline(argc, argv);
gstate.now = dtime();
int flags =
BOINC_DIAG_DUMPCALLSTACKENABLED |
BOINC_DIAG_HEAPCHECKENABLED |
BOINC_DIAG_TRACETOSTDOUT |
BOINC_DIAG_REDIRECTSTDERR |
BOINC_DIAG_REDIRECTSTDOUT;
diagnostics_init(flags, "stdoutgpudetect", "stderrgpudetect");
read_config_file(true);
coprocs.detect_gpus(warnings);