[gegl] graph: calculate bounding box outside lock in gegl_node_get_cache()



commit ff5b5469a1e75b7f4e0db2b1df3cdb77f1edc542
Author: Ell <ell_se yahoo com>
Date:   Tue Nov 14 09:42:00 2017 -0500

    graph: calculate bounding box outside lock in gegl_node_get_cache()
    
    If we need to calculate the bounding box, gegl_graph_prepare() will
    try to lock the same mutex in the process, and we'd deadlock.

 gegl/graph/gegl-node.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gegl/graph/gegl-node.c b/gegl/graph/gegl-node.c
index f2f898e..d8765fc 100644
--- a/gegl/graph/gegl-node.c
+++ b/gegl/graph/gegl-node.c
@@ -1995,6 +1995,8 @@ gegl_node_get_cache (GeglNode *node)
   if (node->cache)
     return node->cache;
 
+  gegl_node_get_bounding_box (node);
+
   g_mutex_lock (&node->mutex);
 
   if (!node->cache)
@@ -2006,7 +2008,6 @@ gegl_node_get_cache (GeglNode *node)
                             NULL);
 
       gegl_object_set_has_forked (G_OBJECT (cache));
-      gegl_node_get_bounding_box (node);
       gegl_buffer_set_extent (GEGL_BUFFER (cache), &node->have_rect);
 
       g_signal_connect_swapped (G_OBJECT (cache), "computed",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]