mirror of https://github.com/BOINC/boinc.git
Condor interface: race condition fix, from Jamie
This commit is contained in:
parent
65ec42da6c
commit
5bcdacfa64
|
@ -707,14 +707,17 @@ int handle_command(char* p) {
|
||||||
exit(0);
|
exit(0);
|
||||||
} else if (!strcasecmp(cmd, "RESULTS")) {
|
} else if (!strcasecmp(cmd, "RESULTS")) {
|
||||||
flockfile(stdout);
|
flockfile(stdout);
|
||||||
BPRINTF("S %d\n", n_results());
|
int cnt = n_results();
|
||||||
|
BPRINTF("S %d\n", cnt);
|
||||||
vector<COMMAND*>::iterator i = commands.begin();
|
vector<COMMAND*>::iterator i = commands.begin();
|
||||||
while (i != commands.end()) {
|
int j = 0;
|
||||||
|
while (i != commands.end() && j < cnt) {
|
||||||
COMMAND *c2 = *i;
|
COMMAND *c2 = *i;
|
||||||
if (c2->out) {
|
if (c2->out) {
|
||||||
BPRINTF("%d %s\n", c2->id, c2->out);
|
BPRINTF("%d %s\n", c2->id, c2->out);
|
||||||
delete c2;
|
delete c2;
|
||||||
i = commands.erase(i);
|
i = commands.erase(i);
|
||||||
|
j++;
|
||||||
} else {
|
} else {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue