Skip to content

Commit

Permalink
Remove possible deadlock from imagemagick backend
Browse files Browse the repository at this point in the history
This commit is tailored to be cherry-picked into a 2.10.3 release.
  • Loading branch information
phillipberndt committed Apr 15, 2018
1 parent f849b2f commit e88c82a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,12 @@ For some advanced uses of pqiv, take a look at these resouces:
Changelog
---------

pqiv 2.10.2
pqiv 2.10.3
* Fix output of `montage_mode_shift_y_rows()` in key bindings
* Update the info text when the background pattern is cycled
* Prevent potential crashes in poppler backend for rapid image movements
* Fix processing of dangling symlinks in the file buffer
* Removed possible deadlock in ImageMagick wand backend

pqiv 2.10
* Enable cursor auto-hide by default
Expand Down
5 changes: 5 additions & 0 deletions backends/wand.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,17 @@ BOSNode *file_type_wand_alloc(load_images_state_t state, file_t *file) {/*{{{*/
new_file->private = g_slice_new0(file_private_data_wand_t);
((file_private_data_wand_t *)new_file->private)->page_number = n + 1;

// Temporarily give up lock to do this: Otherwise we might see a deadlock
// if another thread holding the file tree's lock is waiting for the wand
// lock for another operation.
G_UNLOCK(magick_wand_global_lock);
if(n == 0) {
first_node = load_images_handle_parameter_add_file(state, new_file);
}
else {
load_images_handle_parameter_add_file(state, new_file);
}
G_LOCK(magick_wand_global_lock);
}

if(first_node) {
Expand Down

0 comments on commit e88c82a

Please sign in to comment.