[evince] dvi: Don't use g_mutex_new().
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] dvi: Don't use g_mutex_new().
- Date: Sun, 4 Dec 2011 12:11:15 +0000 (UTC)
commit 76151be92239ed5f491cb26c87a2328b670e9f64
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Sun Dec 4 13:10:54 2011 +0100
dvi: Don't use g_mutex_new().
backend/dvi/dvi-document.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/backend/dvi/dvi-document.c b/backend/dvi/dvi-document.c
index 89d3189..8a3316b 100644
--- a/backend/dvi/dvi-document.c
+++ b/backend/dvi/dvi-document.c
@@ -40,7 +40,7 @@
#endif
#include <stdlib.h>
-GMutex *dvi_context_mutex = NULL;
+GMutex dvi_context_mutex;
enum {
PROP_0,
@@ -95,12 +95,12 @@ dvi_document_load (EvDocument *document,
if (!filename)
return FALSE;
- g_mutex_lock (dvi_context_mutex);
+ g_mutex_lock (&dvi_context_mutex);
if (dvi_document->context)
mdvi_destroy_context (dvi_document->context);
dvi_document->context = mdvi_init_context(dvi_document->params, dvi_document->spec, filename);
- g_mutex_unlock (dvi_context_mutex);
+ g_mutex_unlock (&dvi_context_mutex);
g_free (filename);
if (!dvi_document->context) {
@@ -172,7 +172,7 @@ dvi_document_render (EvDocument *document,
* thread safe. The work to the future -
* let context render page independently
*/
- g_mutex_lock (dvi_context_mutex);
+ g_mutex_lock (&dvi_context_mutex);
mdvi_setpage (dvi_document->context, rc->page->index);
@@ -195,7 +195,7 @@ dvi_document_render (EvDocument *document,
mdvi_cairo_device_render (dvi_document->context);
surface = mdvi_cairo_device_get_surface (&dvi_document->context->device);
- g_mutex_unlock (dvi_context_mutex);
+ g_mutex_unlock (&dvi_context_mutex);
rotated_surface = ev_document_misc_surface_rotate_and_scale (surface,
required_width,
@@ -211,12 +211,12 @@ dvi_document_finalize (GObject *object)
{
DviDocument *dvi_document = DVI_DOCUMENT(object);
- g_mutex_lock (dvi_context_mutex);
+ g_mutex_lock (&dvi_context_mutex);
if (dvi_document->context) {
mdvi_cairo_device_free (&dvi_document->context->device);
mdvi_destroy_context (dvi_document->context);
}
- g_mutex_unlock (dvi_context_mutex);
+ g_mutex_unlock (&dvi_context_mutex);
if (dvi_document->params)
g_free (dvi_document->params);
@@ -254,8 +254,6 @@ dvi_document_class_init (DviDocumentClass *klass)
mdvi_register_special ("Color", "color", NULL, dvi_document_do_color_special, 1);
mdvi_register_fonts ();
- dvi_context_mutex = g_mutex_new ();
-
ev_document_class->load = dvi_document_load;
ev_document_class->save = dvi_document_save;
ev_document_class->get_n_pages = dvi_document_get_n_pages;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]