Fix bug that seems to be causing some contention among the threads

This commit is contained in:
Kevin Keogh
2017-07-30 17:19:28 -04:00
parent 7559bd23bb
commit 824ed8441a
2 changed files with 3 additions and 0 deletions

Binary file not shown.

View File

@@ -103,7 +103,10 @@ void gbm(struct Option *opt)
options = malloc(sizeof(struct Option) * NUM_THREADS); options = malloc(sizeof(struct Option) * NUM_THREADS);
for(i=0; i<NUM_THREADS; i++) { for(i=0; i<NUM_THREADS; i++) {
options[i] = *opt; options[i] = *opt;
options[i].expiry_date = opt->expiry_date;
options[i].value_date = opt->value_date;
} }
threads = malloc(sizeof(pthread_t) * NUM_THREADS); threads = malloc(sizeof(pthread_t) * NUM_THREADS);
opt->sims = opt->sims / NUM_THREADS; opt->sims = opt->sims / NUM_THREADS;