diff options
author | Thomas White <taw@physics.org> | 2019-10-16 16:42:29 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-10-17 10:03:41 +0200 |
commit | 96861c596671a185b1e2fc24c60d6fbdf6ee865d (patch) | |
tree | 66240f9978d094603bb7849df3d0a2857eecc2cf /src/process_image.c | |
parent | bff069f97ad705b44e0432f93597a874d19baa8a (diff) |
indexamajig: Shut down gracefully after failed image load
Diffstat (limited to 'src/process_image.c')
-rw-r--r-- | src/process_image.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/process_image.c b/src/process_image.c index f28952bc..dbb9bc2e 100644 --- a/src/process_image.c +++ b/src/process_image.c @@ -223,7 +223,15 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs, } else { if ( file_wait_open_read(sb_shared, &image, taccs, last_task, iargs->wait_for_file, cookie, - &imfile) ) return; + &imfile) ) + { + if ( iargs->wait_for_file != 0 ) { + pthread_mutex_lock(&sb_shared->totals_lock); + sb_shared->should_shutdown = 1; + pthread_mutex_unlock(&sb_shared->totals_lock); + } + return; + } } image.bw = iargs->beam->bandwidth; |