Fixed a bug in the end condition for threads
This commit is contained in:
@ -660,6 +660,14 @@ 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;
|
||||||
|
@ -49,6 +49,14 @@ int main(int argc, char* argv[]){
|
|||||||
total_states = craptev1_sizeof_space(space);
|
total_states = craptev1_sizeof_space(space);
|
||||||
|
|
||||||
thread_count = get_nprocs_conf();
|
thread_count = get_nprocs_conf();
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
pthread_t threads[thread_count];
|
pthread_t threads[thread_count];
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
@ -72,6 +72,14 @@ int main(int argc, char* argv[]){
|
|||||||
total_states = craptev1_sizeof_space(space);
|
total_states = craptev1_sizeof_space(space);
|
||||||
|
|
||||||
thread_count = get_nprocs_conf();
|
thread_count = get_nprocs_conf();
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
pthread_t threads[thread_count];
|
pthread_t threads[thread_count];
|
||||||
printf("Starting %zu threads to test %zu states\n", thread_count, total_states);
|
printf("Starting %zu threads to test %zu states\n", thread_count, total_states);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -73,6 +73,14 @@ int main(int argc, char* argv[]){
|
|||||||
total_states = craptev1_sizeof_space(space);
|
total_states = craptev1_sizeof_space(space);
|
||||||
|
|
||||||
thread_count = get_nprocs_conf();
|
thread_count = get_nprocs_conf();
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
pthread_t threads[thread_count];
|
pthread_t threads[thread_count];
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user