[clutter/wip/actor-content: 27/33] image-loader/pixbuf: Take the lock in load_stream()



commit 1aa20976e26392fa0271b8c67d6353a90e10cc1f
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Mon Apr 18 15:18:02 2011 +0100

    image-loader/pixbuf: Take the lock in load_stream()
    
    Make sure that we take the Clutter master lock when using Cogl's API,
    since load_stream() is the synchronous API, and it could be called
    from different threads.

 .../image-loaders/clutter-image-loader-pixbuf.c    |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/clutter/image-loaders/clutter-image-loader-pixbuf.c b/clutter/image-loaders/clutter-image-loader-pixbuf.c
index cfa02bc..033736b 100644
--- a/clutter/image-loaders/clutter-image-loader-pixbuf.c
+++ b/clutter/image-loaders/clutter-image-loader-pixbuf.c
@@ -110,6 +110,8 @@ clutter_image_loader_pixbuf_load_stream (ClutterImageLoader     *loader,
   if (pixbuf == NULL)
     return FALSE;
 
+  clutter_threads_enter ();
+
   self->image_width = gdk_pixbuf_get_width (pixbuf);
   self->image_height = gdk_pixbuf_get_height (pixbuf);
   self->pixel_format = gdk_pixbuf_get_has_alpha (pixbuf)
@@ -139,6 +141,8 @@ clutter_image_loader_pixbuf_load_stream (ClutterImageLoader     *loader,
                          CLUTTER_IMAGE_ERROR_INVALID_DATA,
                          _("Unable to load the image data"));
 
+  clutter_threads_leave ();
+
   return (self->texture != COGL_INVALID_HANDLE);
 }
 



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