summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-07-27 13:37:35 +0200
committerinfirit <[email protected]>2014-07-27 21:16:30 +0200
commit2d979e654ebe948be627f6794ed2d1e5fe10efbb (patch)
treebb36d5a95264334e40985268f1d5e3f168127708 /src
parent31c430bc216d63c4dcf7aca9809f53ce3ef94efc (diff)
downloadeom-2d979e654ebe948be627f6794ed2d1e5fe10efbb.tar.bz2
eom-2d979e654ebe948be627f6794ed2d1e5fe10efbb.tar.xz
Revert "Don't use deprecated GLib threading API."
This reverts commit 13f1c75845c8a55a95d2c5426dbf343e3828bc78. Has an unrelated change included so we need to split this.
Diffstat (limited to 'src')
-rw-r--r--src/eom-exif-util.c15
-rw-r--r--src/eom-job-queue.c26
2 files changed, 25 insertions, 16 deletions
diff --git a/src/eom-exif-util.c b/src/eom-exif-util.c
index c4074d6..7fa0e99 100644
--- a/src/eom-exif-util.c
+++ b/src/eom-exif-util.c
@@ -48,9 +48,6 @@
#define GPOINTER_TO_BOOLEAN(i) ((gboolean) ((GPOINTER_TO_INT (i) == 2) ? TRUE : FALSE))
#endif
-/* Define EogExifData type */
-G_DEFINE_BOXED_TYPE(EomExifData, eom_exif_data, eom_exif_data_copy, eom_exif_data_free)
-
static gpointer
_check_strptime_updates_wday (gpointer data)
{
@@ -229,3 +226,15 @@ eom_exif_data_free (EomExifData *data)
{
exif_data_unref (data);
}
+
+GType
+eom_exif_data_get_type (void)
+{
+ static GType our_type = 0;
+
+ if (our_type == 0)
+ our_type = g_boxed_type_register_static ("EomExifData",
+ (GBoxedCopyFunc) eom_exif_data_copy,
+ (GBoxedFreeFunc) eom_exif_data_free);
+ return our_type;
+}
diff --git a/src/eom-job-queue.c b/src/eom-job-queue.c
index 8452de5..007e0a3 100644
--- a/src/eom-job-queue.c
+++ b/src/eom-job-queue.c
@@ -25,8 +25,8 @@
#include "eom-jobs.h"
#include "eom-job-queue.h"
-static GCond render_cond;
-static GMutex eom_queue_mutex;
+static GCond *render_cond = NULL;
+static GMutex *eom_queue_mutex = NULL;
static GQueue *thumbnail_queue = NULL;
static GQueue *load_queue = NULL;
@@ -57,7 +57,7 @@ add_job_to_queue_locked (GQueue *queue, EomJob *job)
{
g_object_ref (job);
g_queue_push_tail (queue, job);
- g_cond_broadcast (&render_cond);
+ g_cond_broadcast (render_cond);
}
static gboolean
@@ -131,15 +131,15 @@ eom_render_thread (gpointer data)
while (TRUE) {
EomJob *job;
- g_mutex_lock (&eom_queue_mutex);
+ g_mutex_lock (eom_queue_mutex);
if (no_jobs_available_unlocked ()) {
- g_cond_wait (&render_cond, &eom_queue_mutex);
+ g_cond_wait (render_cond, eom_queue_mutex);
}
job = search_for_jobs_unlocked ();
- g_mutex_unlock (&eom_queue_mutex);
+ g_mutex_unlock (eom_queue_mutex);
/* Now that we have our job, we handle it */
if (job) {
@@ -154,8 +154,8 @@ eom_render_thread (gpointer data)
void
eom_job_queue_init (void)
{
- g_cond_init (&render_cond);
- g_mutex_init (&eom_queue_mutex);
+ render_cond = g_cond_new ();
+ eom_queue_mutex = g_mutex_new ();
thumbnail_queue = g_queue_new ();
load_queue = g_queue_new ();
@@ -164,7 +164,7 @@ eom_job_queue_init (void)
save_queue = g_queue_new ();
copy_queue = g_queue_new ();
- g_thread_new ("EomJobQueue", eom_render_thread, NULL);
+ g_thread_create (eom_render_thread, NULL, FALSE, NULL);
}
static GQueue *
@@ -198,11 +198,11 @@ eom_job_queue_add_job (EomJob *job)
queue = find_queue (job);
- g_mutex_lock (&eom_queue_mutex);
+ g_mutex_lock (eom_queue_mutex);
add_job_to_queue_locked (queue, job);
- g_mutex_unlock (&eom_queue_mutex);
+ g_mutex_unlock (eom_queue_mutex);
}
gboolean
@@ -212,7 +212,7 @@ eom_job_queue_remove_job (EomJob *job)
g_return_val_if_fail (EOM_IS_JOB (job), FALSE);
- g_mutex_lock (&eom_queue_mutex);
+ g_mutex_lock (eom_queue_mutex);
if (EOM_IS_JOB_THUMBNAIL (job)) {
retval = remove_job_from_queue (thumbnail_queue, job);
@@ -230,7 +230,7 @@ eom_job_queue_remove_job (EomJob *job)
g_assert_not_reached ();
}
- g_mutex_unlock (&eom_queue_mutex);
+ g_mutex_unlock (eom_queue_mutex);
return retval;
}