From 7dd30a42cfdd5c631881e67144786c8d54ed6d9c Mon Sep 17 00:00:00 2001 From: "Ignas Anikevicius (gns_ank)" Date: Fri, 8 Feb 2013 14:05:06 +0000 Subject: [PATCH] Fix some mutex deprecation warnings in page-widget According to my compiler output and the page on glib deprecated APIs [1], some of the stuff needed to be removed or changed. [1] - http://developer.gnome.org/glib/2.31/glib-Deprecated-Thread-APIs.html Signed-off-by: Ignas Anikevicius (gns_ank) Signed-off-by: Sebastian Ramacher --- page-widget.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/page-widget.c b/page-widget.c index ac7e93d..d3c34e7 100644 --- a/page-widget.c +++ b/page-widget.c @@ -22,7 +22,7 @@ typedef struct zathura_page_widget_private_s { zathura_t* zathura; /**< Zathura object */ cairo_surface_t* surface; /**< Cairo surface */ gint64 last_view; /**< Last time the page has been viewed */ - GStaticMutex lock; /**< Lock */ + GMutex lock; /**< Lock */ struct { girara_list_t* list; /**< List of links on the page */ @@ -162,7 +162,7 @@ zathura_page_widget_init(ZathuraPage* widget) priv->mouse.selection_basepoint.x = -1; priv->mouse.selection_basepoint.y = -1; - g_static_mutex_init(&(priv->lock)); + g_mutex_init(&(priv->lock)); /* we want mouse events */ gtk_widget_add_events(GTK_WIDGET(widget), @@ -195,8 +195,6 @@ zathura_page_widget_finalize(GObject* object) girara_list_free(priv->links.list); } - g_static_mutex_free(&(priv->lock)); - G_OBJECT_CLASS(zathura_page_widget_parent_class)->finalize(object); } @@ -325,7 +323,7 @@ static gboolean zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) { zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); - g_static_mutex_lock(&(priv->lock)); + g_mutex_lock(&(priv->lock)); zathura_document_t* document = zathura_page_get_document(priv->page); @@ -466,7 +464,7 @@ zathura_page_widget_draw(GtkWidget* widget, cairo_t* cairo) /* render real page */ render_page(priv->zathura->sync.render_thread, priv->page); } - g_static_mutex_unlock(&(priv->lock)); + g_mutex_unlock(&(priv->lock)); return FALSE; } @@ -481,13 +479,13 @@ void zathura_page_widget_update_surface(ZathuraPage* widget, cairo_surface_t* surface) { zathura_page_widget_private_t* priv = ZATHURA_PAGE_GET_PRIVATE(widget); - g_static_mutex_lock(&(priv->lock)); + g_mutex_lock(&(priv->lock)); if (priv->surface != NULL) { cairo_surface_finish(priv->surface); cairo_surface_destroy(priv->surface); } priv->surface = surface; - g_static_mutex_unlock(&(priv->lock)); + g_mutex_unlock(&(priv->lock)); /* force a redraw here */ zathura_page_widget_redraw_canvas(widget); }