Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/backend/ev-document.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2006-12-18 15:26:40 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2006-12-18 15:26:40 (GMT)
commit87db0f592b3ffee3043b4e701be8c8c0132e3520 (patch)
tree7776e905af1f99287ca9a13e12ff55986758bdc2 /backend/ev-document.c
parent67f80b85d70a6d577e36c9578b854003a7d910ca (diff)
Use an specific lock for FontConfig. Hopefully it fixes some crashes
2006-12-18 Carlos Garcia Campos <carlosgc@gnome.org> * backend/ev-document.[ch]: (ev_document_get_fc_mutex), (ev_document_fc_mutex_lock), (ev_document_fc_mutex_unlock): * pdf/ev-poppler.cc: (make_thumbnail_for_size): * shell/ev-jobs.c: (ev_job_render_run), (ev_job_fonts_run): * shell/ev-view.c: (draw_loading_text): * shell/ev-window.c: (ev_window_cmd_file_properties): Use an specific lock for FontConfig. Hopefully it fixes some crashes related to using FontConfig from different threads.
Diffstat (limited to 'backend/ev-document.c')
-rw-r--r--backend/ev-document.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/backend/ev-document.c b/backend/ev-document.c
index 94647c6..a951bfa 100644
--- a/backend/ev-document.c
+++ b/backend/ev-document.c
@@ -28,6 +28,7 @@ static void ev_document_class_init (gpointer g_class);
GMutex *ev_doc_mutex = NULL;
+GMutex *ev_fc_mutex = NULL;
#define LOG(x)
GType
@@ -89,7 +90,26 @@ ev_document_doc_mutex_unlock (void)
g_mutex_unlock (ev_document_get_doc_mutex ());
}
+GMutex *
+ev_document_get_fc_mutex (void)
+{
+ if (ev_fc_mutex == NULL) {
+ ev_fc_mutex = g_mutex_new ();
+ }
+ return ev_fc_mutex;
+}
+void
+ev_document_fc_mutex_lock (void)
+{
+ g_mutex_lock (ev_document_get_fc_mutex ());
+}
+
+void
+ev_document_fc_mutex_unlock (void)
+{
+ g_mutex_unlock (ev_document_get_fc_mutex ());
+}
gboolean
ev_document_load (EvDocument *document,