Fixed a bug in the end condition for threads

This commit is contained in:
Aram
2016-05-11 20:46:34 +02:00
parent 7a0ec5e052
commit 6d274c1a73
4 changed files with 32 additions and 0 deletions

View File

@ -73,6 +73,14 @@ int main(int argc, char* argv[]){
total_states = craptev1_sizeof_space(space);
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];
size_t i;