Moved fix for bug in the end condition for threads to the proper place

This commit is contained in:
Aram
2016-05-11 23:50:09 +02:00
parent 982912a884
commit 7539da08b8

View File

@ -660,14 +660,6 @@ int main (int argc, const char * argv[]) {
space = craptev1_get_space(nonces, 95, uid);
}
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);
} else {
total_states = 0;
@ -676,6 +668,14 @@ int main (int argc, const char * argv[]) {
fprintf(stderr, "No solution found :(\n");
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();
pthread_t threads[thread_count];