diff options
author | Thomas White <taw@physics.org> | 2010-08-10 14:23:33 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:55 +0100 |
commit | ebe34e4bb8b246541e39e5ffbeb570e47cf07131 (patch) | |
tree | 68684ca9609e3f55f5f10233af8dc726331452f4 | |
parent | 4399271bb9841080be59870c10f8d39d877eebb5 (diff) |
indexamajig: Avoid re-counting images when the threads are joined
-rw-r--r-- | src/indexamajig.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c index dd1c81fc..f7eef166 100644 --- a/src/indexamajig.c +++ b/src/indexamajig.c @@ -716,13 +716,20 @@ int main(int argc, char *argv[]) pthread_mutex_unlock(&pargs->control_mutex); if ( !done ) continue; - /* Record the result */ - n_hits += pargs->hit; - n_sane += pargs->peaks_sane; + /* Results will be processed after checking if + * there are any more images to process. */ /* Get next filename */ rval = fgets(line, 1023, fh); + /* In this case, the result of the last file + * file will be processed when the thread is + * joined. */ if ( rval == NULL ) break; + + /* Record the result */ + n_hits += pargs->hit; + n_sane += pargs->peaks_sane; + chomp(line); snprintf(pargs->filename, 1023, "%s%s", prefix, line); |