Moved fix for bug in the end condition for threads to the proper place
This commit is contained in:
@ -660,14 +660,6 @@ int main (int argc, const char * argv[]) {
|
|||||||
space = craptev1_get_space(nonces, 95, uid);
|
space = craptev1_get_space(nonces, 95, uid);
|
||||||
}
|
}
|
||||||
if(space){
|
if(space){
|
||||||
// append some zeroes to the end of the space to make sure threads don't go off into the wild
|
|
||||||
size_t j = 0;
|
|
||||||
for(j = 0; space[j]; j+=5){
|
|
||||||
}
|
|
||||||
size_t fill = j + (5*thread_count);
|
|
||||||
for(; j < fill; j++) {
|
|
||||||
space[j] = 0;
|
|
||||||
}
|
|
||||||
total_states = craptev1_sizeof_space(space);
|
total_states = craptev1_sizeof_space(space);
|
||||||
} else {
|
} else {
|
||||||
total_states = 0;
|
total_states = 0;
|
||||||
@ -676,6 +668,14 @@ int main (int argc, const char * argv[]) {
|
|||||||
fprintf(stderr, "No solution found :(\n");
|
fprintf(stderr, "No solution found :(\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
// append some zeroes to the end of the space to make sure threads don't go off into the wild
|
||||||
|
size_t j = 0;
|
||||||
|
for(j = 0; space[j]; j+=5){
|
||||||
|
}
|
||||||
|
size_t fill = j + (5*thread_count);
|
||||||
|
for(; j < fill; j++) {
|
||||||
|
space[j] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
thread_count = get_nprocs_conf();
|
thread_count = get_nprocs_conf();
|
||||||
pthread_t threads[thread_count];
|
pthread_t threads[thread_count];
|
||||||
|
Reference in New Issue
Block a user