summaryrefslogtreecommitdiff
path: root/src/threads/Workers.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/threads/Workers.c')
-rw-r--r--src/threads/Workers.c620
1 files changed, 352 insertions, 268 deletions
diff --git a/src/threads/Workers.c b/src/threads/Workers.c
index 0391730..4f250d1 100644
--- a/src/threads/Workers.c
+++ b/src/threads/Workers.c
@@ -1,4 +1,4 @@
-/* Workers.c generated by valac 0.36.6, the Vala compiler
+/* Workers.c generated by valac 0.40.4, the Vala compiler
* generated from Workers.vala, do not modify */
/* Copyright 2016 Software Freedom Conservancy Inc.
@@ -7,6 +7,7 @@
* See the COPYING file in this distribution.
*/
+
#include <glib.h>
#include <glib-object.h>
#include <gee.h>
@@ -34,6 +35,11 @@ typedef struct _SortedListPrivate SortedListPrivate;
typedef struct _BackgroundJobBatch BackgroundJobBatch;
typedef struct _BackgroundJobBatchClass BackgroundJobBatchClass;
typedef struct _BackgroundJobBatchPrivate BackgroundJobBatchPrivate;
+enum {
+ BACKGROUND_JOB_BATCH_0_PROPERTY,
+ BACKGROUND_JOB_BATCH_NUM_PROPERTIES
+};
+static GParamSpec* background_job_batch_properties[BACKGROUND_JOB_BATCH_NUM_PROPERTIES];
#define TYPE_BACKGROUND_JOB (background_job_get_type ())
#define BACKGROUND_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKGROUND_JOB, BackgroundJob))
@@ -135,57 +141,92 @@ static gpointer workers_parent_class = NULL;
GType sorted_list_get_type (void) G_GNUC_CONST;
GType background_job_batch_get_type (void) G_GNUC_CONST;
-enum {
- BACKGROUND_JOB_BATCH_DUMMY_PROPERTY
-};
BackgroundJobBatch* background_job_batch_new (void);
BackgroundJobBatch* background_job_batch_construct (GType object_type);
-gint64 background_job_priority_comparator (void* a, void* b);
-static gint64 _background_job_priority_comparator_comparator (void* a, void* b, gpointer self);
-SortedList* sorted_list_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, Comparator cmp, void* cmp_target);
-SortedList* sorted_list_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func, Comparator cmp, void* cmp_target);
+gint64 background_job_priority_comparator (void* a,
+ void* b);
+static gint64 _background_job_priority_comparator_comparator (void* a,
+ void* b,
+ gpointer self);
+SortedList* sorted_list_new (GType g_type,
+ GBoxedCopyFunc g_dup_func,
+ GDestroyNotify g_destroy_func,
+ Comparator cmp,
+ void* cmp_target);
+SortedList* sorted_list_construct (GType object_type,
+ GType g_type,
+ GBoxedCopyFunc g_dup_func,
+ GDestroyNotify g_destroy_func,
+ Comparator cmp,
+ void* cmp_target);
gpointer background_job_ref (gpointer instance);
void background_job_unref (gpointer instance);
-GParamSpec* param_spec_background_job (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-void value_set_background_job (GValue* value, gpointer v_object);
-void value_take_background_job (GValue* value, gpointer v_object);
+GParamSpec* param_spec_background_job (const gchar* name,
+ const gchar* nick,
+ const gchar* blurb,
+ GType object_type,
+ GParamFlags flags);
+void value_set_background_job (GValue* value,
+ gpointer v_object);
+void value_take_background_job (GValue* value,
+ gpointer v_object);
gpointer value_get_background_job (const GValue* value);
GType background_job_get_type (void) G_GNUC_CONST;
gpointer workers_ref (gpointer instance);
void workers_unref (gpointer instance);
-GParamSpec* param_spec_workers (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-void value_set_workers (GValue* value, gpointer v_object);
-void value_take_workers (GValue* value, gpointer v_object);
+GParamSpec* param_spec_workers (const gchar* name,
+ const gchar* nick,
+ const gchar* blurb,
+ GType object_type,
+ GParamFlags flags);
+void value_set_workers (GValue* value,
+ gpointer v_object);
+void value_take_workers (GValue* value,
+ gpointer v_object);
gpointer value_get_workers (const GValue* value);
GType workers_get_type (void) G_GNUC_CONST;
gpointer abstract_semaphore_ref (gpointer instance);
void abstract_semaphore_unref (gpointer instance);
-GParamSpec* param_spec_abstract_semaphore (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
-void value_set_abstract_semaphore (GValue* value, gpointer v_object);
-void value_take_abstract_semaphore (GValue* value, gpointer v_object);
+GParamSpec* param_spec_abstract_semaphore (const gchar* name,
+ const gchar* nick,
+ const gchar* blurb,
+ GType object_type,
+ GParamFlags flags);
+void value_set_abstract_semaphore (GValue* value,
+ gpointer v_object);
+void value_take_abstract_semaphore (GValue* value,
+ gpointer v_object);
gpointer value_get_abstract_semaphore (const GValue* value);
GType abstract_semaphore_get_type (void) G_GNUC_CONST;
GType event_semaphore_get_type (void) G_GNUC_CONST;
#define WORKERS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_WORKERS, WorkersPrivate))
-enum {
- WORKERS_DUMMY_PROPERTY
-};
static void _background_job_unref0_ (gpointer var);
EventSemaphore* event_semaphore_new (void);
EventSemaphore* event_semaphore_construct (GType object_type);
#define WORKERS_UNLIMITED_THREADS -1
-Workers* workers_new (guint max_threads, gboolean exclusive);
-Workers* workers_construct (GType object_type, guint max_threads, gboolean exclusive);
+Workers* workers_new (guint max_threads,
+ gboolean exclusive);
+Workers* workers_construct (GType object_type,
+ guint max_threads,
+ gboolean exclusive);
void abstract_semaphore_notify (AbstractSemaphore* self);
-static void workers_thread_start (Workers* self, void* ignored);
-static void _workers_thread_start_gfunc (gpointer data, gpointer self);
-guint workers_threads_per_cpu (gint per, gint max);
+static void workers_thread_start (Workers* self,
+ void* ignored);
+static void _workers_thread_start_gfunc (gpointer data,
+ gpointer self);
+guint workers_threads_per_cpu (gint per,
+ gint max);
guint workers_thread_per_cpu_minus_one (void);
-void workers_enqueue (Workers* self, BackgroundJob* job);
+void workers_enqueue (Workers* self,
+ BackgroundJob* job);
gboolean abstract_semaphore_reset (AbstractSemaphore* self);
-gint background_job_priority_compare_func (BackgroundJob* a, BackgroundJob* b);
-static gint _background_job_priority_compare_func_gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
-void workers_enqueue_many (Workers* self, BackgroundJobBatch* batch);
+gint background_job_priority_compare_func (BackgroundJob* a,
+ BackgroundJob* b);
+static gint _background_job_priority_compare_func_gcompare_data_func (gconstpointer a,
+ gconstpointer b,
+ gpointer self);
+void workers_enqueue_many (Workers* self,
+ BackgroundJobBatch* batch);
void workers_wait_for_empty_queue (Workers* self);
void abstract_semaphore_wait (AbstractSemaphore* self);
gint workers_get_pending_job_count (Workers* self);
@@ -195,44 +236,58 @@ void background_job_internal_notify_completion (BackgroundJob* self);
static void workers_finalize (Workers * obj);
-static gint64 _background_job_priority_comparator_comparator (void* a, void* b, gpointer self) {
+static gint64
+_background_job_priority_comparator_comparator (void* a,
+ void* b,
+ gpointer self)
+{
gint64 result;
result = background_job_priority_comparator (a, b);
#line 10 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return result;
-#line 204 "Workers.c"
+#line 249 "Workers.c"
}
-BackgroundJobBatch* background_job_batch_construct (GType object_type) {
+BackgroundJobBatch*
+background_job_batch_construct (GType object_type)
+{
BackgroundJobBatch * self = NULL;
#line 10 "/home/jens/Source/shotwell/src/threads/Workers.vala"
self = (BackgroundJobBatch*) sorted_list_construct (object_type, TYPE_BACKGROUND_JOB, (GBoxedCopyFunc) background_job_ref, (GDestroyNotify) background_job_unref, _background_job_priority_comparator_comparator, NULL);
#line 9 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return self;
-#line 214 "Workers.c"
+#line 261 "Workers.c"
}
-BackgroundJobBatch* background_job_batch_new (void) {
+BackgroundJobBatch*
+background_job_batch_new (void)
+{
#line 9 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return background_job_batch_construct (TYPE_BACKGROUND_JOB_BATCH);
-#line 221 "Workers.c"
+#line 270 "Workers.c"
}
-static void background_job_batch_class_init (BackgroundJobBatchClass * klass) {
+static void
+background_job_batch_class_init (BackgroundJobBatchClass * klass)
+{
#line 8 "/home/jens/Source/shotwell/src/threads/Workers.vala"
background_job_batch_parent_class = g_type_class_peek_parent (klass);
-#line 228 "Workers.c"
+#line 279 "Workers.c"
}
-static void background_job_batch_instance_init (BackgroundJobBatch * self) {
+static void
+background_job_batch_instance_init (BackgroundJobBatch * self)
+{
}
-GType background_job_batch_get_type (void) {
+GType
+background_job_batch_get_type (void)
+{
static volatile gsize background_job_batch_type_id__volatile = 0;
if (g_once_init_enter (&background_job_batch_type_id__volatile)) {
static const GTypeInfo g_define_type_info = { sizeof (BackgroundJobBatchClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) background_job_batch_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BackgroundJobBatch), 0, (GInstanceInitFunc) background_job_batch_instance_init, NULL };
@@ -244,74 +299,70 @@ GType background_job_batch_get_type (void) {
}
-static void _background_job_unref0_ (gpointer var) {
+static void
+_background_job_unref0_ (gpointer var)
+{
#line 19 "/home/jens/Source/shotwell/src/threads/Workers.vala"
(var == NULL) ? NULL : (var = (background_job_unref (var), NULL));
-#line 251 "Workers.c"
+#line 308 "Workers.c"
}
-static void _workers_thread_start_gfunc (gpointer data, gpointer self) {
+static void
+_workers_thread_start_gfunc (gpointer data,
+ gpointer self)
+{
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
workers_thread_start ((Workers*) self, data);
-#line 258 "Workers.c"
+#line 318 "Workers.c"
}
-Workers* workers_construct (GType object_type, guint max_threads, gboolean exclusive) {
+Workers*
+workers_construct (GType object_type,
+ guint max_threads,
+ gboolean exclusive)
+{
Workers* self = NULL;
gboolean _tmp0_ = FALSE;
- guint _tmp1_;
- EventSemaphore* _tmp3_;
+ EventSemaphore* _tmp1_;
GError * _inner_error_ = NULL;
#line 23 "/home/jens/Source/shotwell/src/threads/Workers.vala"
self = (Workers*) g_type_create_instance (object_type);
#line 24 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp1_ = max_threads;
-#line 24 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- if (_tmp1_ <= ((guint) 0)) {
-#line 274 "Workers.c"
- guint _tmp2_;
-#line 24 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp2_ = max_threads;
+ if (max_threads <= ((guint) 0)) {
#line 24 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp0_ = _tmp2_ != ((guint) WORKERS_UNLIMITED_THREADS);
-#line 280 "Workers.c"
+ _tmp0_ = max_threads != ((guint) WORKERS_UNLIMITED_THREADS);
+#line 337 "Workers.c"
} else {
#line 24 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_tmp0_ = FALSE;
-#line 284 "Workers.c"
+#line 341 "Workers.c"
}
#line 24 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (_tmp0_) {
#line 25 "/home/jens/Source/shotwell/src/threads/Workers.vala"
max_threads = (guint) 1;
-#line 290 "Workers.c"
+#line 347 "Workers.c"
}
#line 28 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp3_ = self->priv->empty_event;
+ _tmp1_ = self->priv->empty_event;
#line 28 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- abstract_semaphore_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphore));
-#line 296 "Workers.c"
+ abstract_semaphore_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphore));
+#line 353 "Workers.c"
{
- GThreadPool* _tmp4_ = NULL;
- guint _tmp5_;
- gboolean _tmp6_;
- GThreadPool* _tmp7_;
- GThreadPool* _tmp8_;
-#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp5_ = max_threads;
-#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp6_ = exclusive;
+ GThreadPool* _tmp2_ = NULL;
+ GThreadPool* _tmp3_;
+ GThreadPool* _tmp4_;
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp7_ = g_thread_pool_new (_workers_thread_start_gfunc, self, (gint) _tmp5_, _tmp6_, &_inner_error_);
+ _tmp3_ = g_thread_pool_new (_workers_thread_start_gfunc, self, (gint) max_threads, exclusive, &_inner_error_);
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp4_ = _tmp7_;
+ _tmp2_ = _tmp3_;
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (_inner_error_->domain == G_THREAD_ERROR) {
-#line 315 "Workers.c"
+#line 366 "Workers.c"
goto __catch8_g_thread_error;
}
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
@@ -320,36 +371,36 @@ Workers* workers_construct (GType object_type, guint max_threads, gboolean exclu
g_clear_error (&_inner_error_);
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return NULL;
-#line 324 "Workers.c"
+#line 375 "Workers.c"
}
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp8_ = _tmp4_;
+ _tmp4_ = _tmp2_;
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp4_ = NULL;
+ _tmp2_ = NULL;
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_g_thread_pool_free0 (self->priv->thread_pool);
#line 31 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- self->priv->thread_pool = _tmp8_;
+ self->priv->thread_pool = _tmp4_;
#line 30 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _g_thread_pool_free0 (_tmp4_);
-#line 336 "Workers.c"
+ _g_thread_pool_free0 (_tmp2_);
+#line 387 "Workers.c"
}
goto __finally8;
__catch8_g_thread_error:
{
GError* err = NULL;
- const gchar* _tmp9_;
+ const gchar* _tmp5_;
#line 30 "/home/jens/Source/shotwell/src/threads/Workers.vala"
err = _inner_error_;
#line 30 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_inner_error_ = NULL;
#line 33 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp9_ = err->message;
+ _tmp5_ = err->message;
#line 33 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- g_error ("Workers.vala:33: Unable to create thread pool: %s", _tmp9_);
+ g_error ("Workers.vala:33: Unable to create thread pool: %s", _tmp5_);
#line 30 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_g_error_free0 (err);
-#line 353 "Workers.c"
+#line 404 "Workers.c"
}
__finally8:
#line 30 "/home/jens/Source/shotwell/src/threads/Workers.vala"
@@ -360,117 +411,110 @@ Workers* workers_construct (GType object_type, guint max_threads, gboolean exclu
g_clear_error (&_inner_error_);
#line 30 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return NULL;
-#line 364 "Workers.c"
+#line 415 "Workers.c"
}
#line 23 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return self;
-#line 368 "Workers.c"
+#line 419 "Workers.c"
}
-Workers* workers_new (guint max_threads, gboolean exclusive) {
+Workers*
+workers_new (guint max_threads,
+ gboolean exclusive)
+{
#line 23 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return workers_construct (TYPE_WORKERS, max_threads, exclusive);
-#line 375 "Workers.c"
+#line 429 "Workers.c"
}
-guint workers_threads_per_cpu (gint per, gint max) {
+guint
+workers_threads_per_cpu (gint per,
+ gint max)
+{
guint result = 0U;
- gint _tmp0_;
guint count = 0U;
- guint _tmp1_;
- gint _tmp2_;
- guint _tmp3_ = 0U;
- gint _tmp4_;
- guint _tmp9_;
- guint _tmp10_;
-#line 37 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp0_ = per;
+ guint _tmp0_ = 0U;
+ guint _tmp3_;
+ guint _tmp4_;
#line 37 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _vala_return_val_if_fail (_tmp0_ > 0, "per > 0", 0U);
-#line 38 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp1_ = g_get_num_processors ();
+ _vala_return_val_if_fail (per > 0, "per > 0", 0U);
#line 38 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp2_ = per;
-#line 38 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- count = _tmp1_ * _tmp2_;
-#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp4_ = max;
+ count = g_get_num_processors () * per;
#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- if (_tmp4_ < 0) {
-#line 403 "Workers.c"
- guint _tmp5_;
+ if (max < 0) {
+#line 448 "Workers.c"
+ guint _tmp1_;
#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp5_ = count;
+ _tmp1_ = count;
#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp3_ = _tmp5_;
-#line 409 "Workers.c"
+ _tmp0_ = _tmp1_;
+#line 454 "Workers.c"
} else {
- guint _tmp6_;
- gint _tmp7_;
- guint _tmp8_;
-#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp6_ = count;
-#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp7_ = max;
+ guint _tmp2_;
#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp8_ = CLAMP (_tmp6_, (guint) 0, (guint) _tmp7_);
+ _tmp2_ = count;
#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp3_ = _tmp8_;
-#line 422 "Workers.c"
+ _tmp0_ = CLAMP (_tmp2_, (guint) 0, (guint) max);
+#line 461 "Workers.c"
}
#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- result = _tmp3_;
+ result = _tmp0_;
#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp9_ = result;
+ _tmp3_ = result;
#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _vala_warn_if_fail (_tmp9_ > ((guint) 0), "result > 0");
+ _vala_warn_if_fail (_tmp3_ > ((guint) 0), "result > 0");
#line 40 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return result;
-#line 432 "Workers.c"
+#line 471 "Workers.c"
}
-guint workers_thread_per_cpu_minus_one (void) {
+guint
+workers_thread_per_cpu_minus_one (void)
+{
guint result = 0U;
guint _tmp0_;
guint _tmp1_;
- guint _tmp2_;
- guint _tmp3_;
-#line 46 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp0_ = g_get_num_processors ();
#line 46 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp1_ = CLAMP (_tmp0_ - 1, (guint) 1, (guint) G_MAXINT);
+ result = CLAMP (g_get_num_processors () - 1, (guint) 1, (guint) G_MAXINT);
#line 46 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- result = _tmp1_;
+ _tmp0_ = result;
#line 46 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp2_ = result;
-#line 46 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _vala_warn_if_fail (_tmp2_ > ((guint) 0), "result > 0");
+ _vala_warn_if_fail (_tmp0_ > ((guint) 0), "result > 0");
#line 46 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return result;
-#line 454 "Workers.c"
+#line 489 "Workers.c"
}
-static gpointer _background_job_ref0 (gpointer self) {
+static gpointer
+_background_job_ref0 (gpointer self)
+{
#line 55 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return self ? background_job_ref (self) : NULL;
-#line 461 "Workers.c"
+#line 498 "Workers.c"
}
-static gint _background_job_priority_compare_func_gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self) {
+static gint
+_background_job_priority_compare_func_gcompare_data_func (gconstpointer a,
+ gconstpointer b,
+ gpointer self)
+{
gint result;
result = background_job_priority_compare_func ((BackgroundJob*) a, (BackgroundJob*) b);
#line 55 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return result;
-#line 470 "Workers.c"
+#line 511 "Workers.c"
}
-void workers_enqueue (Workers* self, BackgroundJob* job) {
+void
+workers_enqueue (Workers* self,
+ BackgroundJob* job)
+{
EventSemaphore* _tmp0_;
GError * _inner_error_ = NULL;
#line 51 "/home/jens/Source/shotwell/src/threads/Workers.vala"
@@ -481,41 +525,38 @@ void workers_enqueue (Workers* self, BackgroundJob* job) {
_tmp0_ = self->priv->empty_event;
#line 52 "/home/jens/Source/shotwell/src/threads/Workers.vala"
abstract_semaphore_reset (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphore));
-#line 485 "Workers.c"
+#line 529 "Workers.c"
{
GAsyncQueue* _tmp1_;
#line 54 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_tmp1_ = self->priv->queue;
#line 54 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_rec_mutex_lock (&self->priv->__lock_queue);
-#line 492 "Workers.c"
+#line 536 "Workers.c"
{
GAsyncQueue* _tmp2_;
BackgroundJob* _tmp3_;
- BackgroundJob* _tmp4_;
- gint _tmp5_;
+ gint _tmp4_;
#line 55 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_tmp2_ = self->priv->queue;
#line 55 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp3_ = job;
+ _tmp3_ = _background_job_ref0 (job);
#line 55 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp4_ = _background_job_ref0 (_tmp3_);
-#line 55 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- g_async_queue_push_sorted (_tmp2_, _tmp4_, _background_job_priority_compare_func_gcompare_data_func, NULL);
+ g_async_queue_push_sorted (_tmp2_, _tmp3_, _background_job_priority_compare_func_gcompare_data_func, NULL);
#line 56 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp5_ = self->priv->enqueued;
+ _tmp4_ = self->priv->enqueued;
#line 56 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- self->priv->enqueued = _tmp5_ + 1;
-#line 510 "Workers.c"
+ self->priv->enqueued = _tmp4_ + 1;
+#line 551 "Workers.c"
}
__finally9:
{
- GAsyncQueue* _tmp6_;
+ GAsyncQueue* _tmp5_;
#line 54 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp6_ = self->priv->queue;
+ _tmp5_ = self->priv->queue;
#line 54 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_rec_mutex_unlock (&self->priv->__lock_queue);
-#line 519 "Workers.c"
+#line 560 "Workers.c"
}
#line 54 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
@@ -525,23 +566,20 @@ void workers_enqueue (Workers* self, BackgroundJob* job) {
g_clear_error (&_inner_error_);
#line 54 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return;
-#line 529 "Workers.c"
+#line 570 "Workers.c"
}
}
{
- GThreadPool* _tmp7_;
- BackgroundJob* _tmp8_;
-#line 60 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp7_ = self->priv->thread_pool;
+ GThreadPool* _tmp6_;
#line 60 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp8_ = job;
+ _tmp6_ = self->priv->thread_pool;
#line 60 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- g_thread_pool_push (_tmp7_, _tmp8_, &_inner_error_);
+ g_thread_pool_push (_tmp6_, job, &_inner_error_);
#line 60 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 60 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (_inner_error_->domain == G_THREAD_ERROR) {
-#line 545 "Workers.c"
+#line 583 "Workers.c"
goto __catch10_g_thread_error;
}
#line 60 "/home/jens/Source/shotwell/src/threads/Workers.vala"
@@ -550,28 +588,28 @@ void workers_enqueue (Workers* self, BackgroundJob* job) {
g_clear_error (&_inner_error_);
#line 60 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return;
-#line 554 "Workers.c"
+#line 592 "Workers.c"
}
}
goto __finally10;
__catch10_g_thread_error:
{
GError* err = NULL;
- GError* _tmp9_;
- const gchar* _tmp10_;
+ GError* _tmp7_;
+ const gchar* _tmp8_;
#line 59 "/home/jens/Source/shotwell/src/threads/Workers.vala"
err = _inner_error_;
#line 59 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_inner_error_ = NULL;
#line 64 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp9_ = err;
+ _tmp7_ = err;
#line 64 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp10_ = _tmp9_->message;
+ _tmp8_ = _tmp7_->message;
#line 64 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- g_warning ("Workers.vala:64: Unable to create worker thread: %s", _tmp10_);
+ g_warning ("Workers.vala:64: Unable to create worker thread: %s", _tmp8_);
#line 59 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_g_error_free0 (err);
-#line 575 "Workers.c"
+#line 613 "Workers.c"
}
__finally10:
#line 59 "/home/jens/Source/shotwell/src/threads/Workers.vala"
@@ -582,68 +620,67 @@ void workers_enqueue (Workers* self, BackgroundJob* job) {
g_clear_error (&_inner_error_);
#line 59 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return;
-#line 586 "Workers.c"
+#line 624 "Workers.c"
}
}
-void workers_enqueue_many (Workers* self, BackgroundJobBatch* batch) {
+void
+workers_enqueue_many (Workers* self,
+ BackgroundJobBatch* batch)
+{
#line 68 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_return_if_fail (IS_WORKERS (self));
#line 68 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_return_if_fail (IS_BACKGROUND_JOB_BATCH (batch));
-#line 596 "Workers.c"
+#line 637 "Workers.c"
{
GeeIterator* _job_it = NULL;
- BackgroundJobBatch* _tmp0_;
- GeeIterator* _tmp1_;
-#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp0_ = batch;
+ GeeIterator* _tmp0_;
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp1_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, GEE_TYPE_ITERABLE, GeeIterable));
+ _tmp0_ = gee_iterable_iterator (G_TYPE_CHECK_INSTANCE_CAST (batch, GEE_TYPE_ITERABLE, GeeIterable));
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _job_it = _tmp1_;
+ _job_it = _tmp0_;
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
while (TRUE) {
-#line 609 "Workers.c"
- GeeIterator* _tmp2_;
- gboolean _tmp3_;
+#line 647 "Workers.c"
+ GeeIterator* _tmp1_;
BackgroundJob* job = NULL;
- GeeIterator* _tmp4_;
- gpointer _tmp5_;
- BackgroundJob* _tmp6_;
-#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp2_ = _job_it;
+ GeeIterator* _tmp2_;
+ gpointer _tmp3_;
+ BackgroundJob* _tmp4_;
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp3_ = gee_iterator_next (_tmp2_);
+ _tmp1_ = _job_it;
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- if (!_tmp3_) {
+ if (!gee_iterator_next (_tmp1_)) {
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
break;
-#line 624 "Workers.c"
+#line 659 "Workers.c"
}
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp4_ = _job_it;
+ _tmp2_ = _job_it;
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp5_ = gee_iterator_get (_tmp4_);
+ _tmp3_ = gee_iterator_get (_tmp2_);
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- job = (BackgroundJob*) _tmp5_;
+ job = (BackgroundJob*) _tmp3_;
#line 70 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp6_ = job;
+ _tmp4_ = job;
#line 70 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- workers_enqueue (self, _tmp6_);
+ workers_enqueue (self, _tmp4_);
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_background_job_unref0 (job);
-#line 638 "Workers.c"
+#line 673 "Workers.c"
}
#line 69 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_g_object_unref0 (_job_it);
-#line 642 "Workers.c"
+#line 677 "Workers.c"
}
}
-void workers_wait_for_empty_queue (Workers* self) {
+void
+workers_wait_for_empty_queue (Workers* self)
+{
EventSemaphore* _tmp0_;
#line 73 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_return_if_fail (IS_WORKERS (self));
@@ -651,16 +688,18 @@ void workers_wait_for_empty_queue (Workers* self) {
_tmp0_ = self->priv->empty_event;
#line 74 "/home/jens/Source/shotwell/src/threads/Workers.vala"
abstract_semaphore_wait (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphore));
-#line 655 "Workers.c"
+#line 692 "Workers.c"
}
-gint workers_get_pending_job_count (Workers* self) {
+gint
+workers_get_pending_job_count (Workers* self)
+{
gint result = 0;
GError * _inner_error_ = NULL;
#line 78 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_return_val_if_fail (IS_WORKERS (self), 0);
-#line 664 "Workers.c"
+#line 703 "Workers.c"
{
GAsyncQueue* _tmp0_;
gint _tmp4_ = 0;
@@ -668,25 +707,25 @@ gint workers_get_pending_job_count (Workers* self) {
_tmp0_ = self->priv->queue;
#line 79 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_rec_mutex_lock (&self->priv->__lock_queue);
-#line 672 "Workers.c"
+#line 711 "Workers.c"
{
gint _tmp1_;
#line 80 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_tmp1_ = self->priv->enqueued;
#line 80 "/home/jens/Source/shotwell/src/threads/Workers.vala"
result = _tmp1_;
-#line 679 "Workers.c"
+#line 718 "Workers.c"
{
GAsyncQueue* _tmp2_;
#line 79 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_tmp2_ = self->priv->queue;
#line 79 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_rec_mutex_unlock (&self->priv->__lock_queue);
-#line 686 "Workers.c"
+#line 725 "Workers.c"
}
#line 80 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return result;
-#line 690 "Workers.c"
+#line 729 "Workers.c"
}
__finally11:
{
@@ -695,7 +734,7 @@ gint workers_get_pending_job_count (Workers* self) {
_tmp3_ = self->priv->queue;
#line 79 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_rec_mutex_unlock (&self->priv->__lock_queue);
-#line 699 "Workers.c"
+#line 738 "Workers.c"
}
#line 79 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
@@ -703,26 +742,28 @@ gint workers_get_pending_job_count (Workers* self) {
g_clear_error (&_inner_error_);
#line 79 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return _tmp4_;
-#line 707 "Workers.c"
+#line 746 "Workers.c"
}
}
-static void workers_thread_start (Workers* self, void* ignored) {
+static void
+workers_thread_start (Workers* self,
+ void* ignored)
+{
BackgroundJob* job = NULL;
gboolean empty = FALSE;
- gboolean _tmp7_;
GError * _inner_error_ = NULL;
#line 84 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_return_if_fail (IS_WORKERS (self));
-#line 719 "Workers.c"
+#line 760 "Workers.c"
{
GAsyncQueue* _tmp0_;
#line 87 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_tmp0_ = self->priv->queue;
#line 87 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_rec_mutex_lock (&self->priv->__lock_queue);
-#line 726 "Workers.c"
+#line 767 "Workers.c"
{
GAsyncQueue* _tmp1_;
gpointer _tmp2_;
@@ -751,7 +792,7 @@ static void workers_thread_start (Workers* self, void* ignored) {
_tmp5_ = self->priv->enqueued;
#line 92 "/home/jens/Source/shotwell/src/threads/Workers.vala"
empty = _tmp5_ == 0;
-#line 755 "Workers.c"
+#line 796 "Workers.c"
}
__finally12:
{
@@ -760,7 +801,7 @@ static void workers_thread_start (Workers* self, void* ignored) {
_tmp6_ = self->priv->queue;
#line 87 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_rec_mutex_unlock (&self->priv->__lock_queue);
-#line 764 "Workers.c"
+#line 805 "Workers.c"
}
#line 87 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (G_UNLIKELY (_inner_error_ != NULL)) {
@@ -772,133 +813,156 @@ static void workers_thread_start (Workers* self, void* ignored) {
g_clear_error (&_inner_error_);
#line 87 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return;
-#line 776 "Workers.c"
+#line 817 "Workers.c"
}
}
#line 95 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp7_ = background_job_is_cancelled (job);
-#line 95 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- if (!_tmp7_) {
+ if (!background_job_is_cancelled (job)) {
#line 96 "/home/jens/Source/shotwell/src/threads/Workers.vala"
background_job_execute (job);
-#line 785 "Workers.c"
+#line 824 "Workers.c"
}
#line 98 "/home/jens/Source/shotwell/src/threads/Workers.vala"
background_job_internal_notify_completion (job);
#line 100 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (empty) {
-#line 791 "Workers.c"
- EventSemaphore* _tmp8_;
+#line 830 "Workers.c"
+ EventSemaphore* _tmp7_;
#line 101 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- _tmp8_ = self->priv->empty_event;
+ _tmp7_ = self->priv->empty_event;
#line 101 "/home/jens/Source/shotwell/src/threads/Workers.vala"
- abstract_semaphore_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphore));
-#line 797 "Workers.c"
+ abstract_semaphore_notify (G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, TYPE_ABSTRACT_SEMAPHORE, AbstractSemaphore));
+#line 836 "Workers.c"
}
#line 84 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_background_job_unref0 (job);
-#line 801 "Workers.c"
+#line 840 "Workers.c"
}
-static void value_workers_init (GValue* value) {
+static void
+value_workers_init (GValue* value)
+{
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
value->data[0].v_pointer = NULL;
-#line 808 "Workers.c"
+#line 849 "Workers.c"
}
-static void value_workers_free_value (GValue* value) {
+static void
+value_workers_free_value (GValue* value)
+{
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (value->data[0].v_pointer) {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
workers_unref (value->data[0].v_pointer);
-#line 817 "Workers.c"
+#line 860 "Workers.c"
}
}
-static void value_workers_copy_value (const GValue* src_value, GValue* dest_value) {
+static void
+value_workers_copy_value (const GValue* src_value,
+ GValue* dest_value)
+{
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (src_value->data[0].v_pointer) {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
dest_value->data[0].v_pointer = workers_ref (src_value->data[0].v_pointer);
-#line 827 "Workers.c"
+#line 873 "Workers.c"
} else {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
dest_value->data[0].v_pointer = NULL;
-#line 831 "Workers.c"
+#line 877 "Workers.c"
}
}
-static gpointer value_workers_peek_pointer (const GValue* value) {
+static gpointer
+value_workers_peek_pointer (const GValue* value)
+{
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return value->data[0].v_pointer;
-#line 839 "Workers.c"
+#line 887 "Workers.c"
}
-static gchar* value_workers_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+static gchar*
+value_workers_collect_value (GValue* value,
+ guint n_collect_values,
+ GTypeCValue* collect_values,
+ guint collect_flags)
+{
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (collect_values[0].v_pointer) {
-#line 846 "Workers.c"
+#line 899 "Workers.c"
Workers * object;
object = collect_values[0].v_pointer;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (object->parent_instance.g_class == NULL) {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
-#line 853 "Workers.c"
+#line 906 "Workers.c"
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
-#line 857 "Workers.c"
+#line 910 "Workers.c"
}
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
value->data[0].v_pointer = workers_ref (object);
-#line 861 "Workers.c"
+#line 914 "Workers.c"
} else {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
value->data[0].v_pointer = NULL;
-#line 865 "Workers.c"
+#line 918 "Workers.c"
}
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return NULL;
-#line 869 "Workers.c"
+#line 922 "Workers.c"
}
-static gchar* value_workers_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
+static gchar*
+value_workers_lcopy_value (const GValue* value,
+ guint n_collect_values,
+ GTypeCValue* collect_values,
+ guint collect_flags)
+{
Workers ** object_p;
object_p = collect_values[0].v_pointer;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (!object_p) {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
-#line 880 "Workers.c"
+#line 938 "Workers.c"
}
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (!value->data[0].v_pointer) {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
*object_p = NULL;
-#line 886 "Workers.c"
+#line 944 "Workers.c"
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
*object_p = value->data[0].v_pointer;
-#line 890 "Workers.c"
+#line 948 "Workers.c"
} else {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
*object_p = workers_ref (value->data[0].v_pointer);
-#line 894 "Workers.c"
+#line 952 "Workers.c"
}
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return NULL;
-#line 898 "Workers.c"
+#line 956 "Workers.c"
}
-GParamSpec* param_spec_workers (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
+GParamSpec*
+param_spec_workers (const gchar* name,
+ const gchar* nick,
+ const gchar* blurb,
+ GType object_type,
+ GParamFlags flags)
+{
ParamSpecWorkers* spec;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_return_val_if_fail (g_type_is_a (object_type, TYPE_WORKERS), NULL);
@@ -908,20 +972,25 @@ GParamSpec* param_spec_workers (const gchar* name, const gchar* nick, const gcha
G_PARAM_SPEC (spec)->value_type = object_type;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return G_PARAM_SPEC (spec);
-#line 912 "Workers.c"
+#line 976 "Workers.c"
}
-gpointer value_get_workers (const GValue* value) {
+gpointer
+value_get_workers (const GValue* value)
+{
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_WORKERS), NULL);
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return value->data[0].v_pointer;
-#line 921 "Workers.c"
+#line 987 "Workers.c"
}
-void value_set_workers (GValue* value, gpointer v_object) {
+void
+value_set_workers (GValue* value,
+ gpointer v_object)
+{
Workers * old;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_WORKERS));
@@ -937,22 +1006,25 @@ void value_set_workers (GValue* value, gpointer v_object) {
value->data[0].v_pointer = v_object;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
workers_ref (value->data[0].v_pointer);
-#line 941 "Workers.c"
+#line 1010 "Workers.c"
} else {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
value->data[0].v_pointer = NULL;
-#line 945 "Workers.c"
+#line 1014 "Workers.c"
}
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (old) {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
workers_unref (old);
-#line 951 "Workers.c"
+#line 1020 "Workers.c"
}
}
-void value_take_workers (GValue* value, gpointer v_object) {
+void
+value_take_workers (GValue* value,
+ gpointer v_object)
+{
Workers * old;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_WORKERS));
@@ -966,33 +1038,37 @@ void value_take_workers (GValue* value, gpointer v_object) {
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
value->data[0].v_pointer = v_object;
-#line 970 "Workers.c"
+#line 1042 "Workers.c"
} else {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
value->data[0].v_pointer = NULL;
-#line 974 "Workers.c"
+#line 1046 "Workers.c"
}
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
if (old) {
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
workers_unref (old);
-#line 980 "Workers.c"
+#line 1052 "Workers.c"
}
}
-static void workers_class_init (WorkersClass * klass) {
+static void
+workers_class_init (WorkersClass * klass)
+{
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
workers_parent_class = g_type_class_peek_parent (klass);
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
((WorkersClass *) klass)->finalize = workers_finalize;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_type_class_add_private (klass, sizeof (WorkersPrivate));
-#line 992 "Workers.c"
+#line 1066 "Workers.c"
}
-static void workers_instance_init (Workers * self) {
+static void
+workers_instance_init (Workers * self)
+{
GAsyncQueue* _tmp0_;
EventSemaphore* _tmp1_;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
@@ -1011,11 +1087,13 @@ static void workers_instance_init (Workers * self) {
self->priv->enqueued = 0;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
self->ref_count = 1;
-#line 1015 "Workers.c"
+#line 1091 "Workers.c"
}
-static void workers_finalize (Workers * obj) {
+static void
+workers_finalize (Workers * obj)
+{
Workers * self;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_WORKERS, Workers);
@@ -1029,11 +1107,13 @@ static void workers_finalize (Workers * obj) {
_g_async_queue_unref0 (self->priv->queue);
#line 20 "/home/jens/Source/shotwell/src/threads/Workers.vala"
_abstract_semaphore_unref0 (self->priv->empty_event);
-#line 1033 "Workers.c"
+#line 1111 "Workers.c"
}
-GType workers_get_type (void) {
+GType
+workers_get_type (void)
+{
static volatile gsize workers_type_id__volatile = 0;
if (g_once_init_enter (&workers_type_id__volatile)) {
static const GTypeValueTable g_define_type_value_table = { value_workers_init, value_workers_free_value, value_workers_copy_value, value_workers_peek_pointer, "p", value_workers_collect_value, "p", value_workers_lcopy_value };
@@ -1047,18 +1127,22 @@ GType workers_get_type (void) {
}
-gpointer workers_ref (gpointer instance) {
+gpointer
+workers_ref (gpointer instance)
+{
Workers * self;
self = instance;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_atomic_int_inc (&self->ref_count);
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
return instance;
-#line 1058 "Workers.c"
+#line 1140 "Workers.c"
}
-void workers_unref (gpointer instance) {
+void
+workers_unref (gpointer instance)
+{
Workers * self;
self = instance;
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
@@ -1067,7 +1151,7 @@ void workers_unref (gpointer instance) {
WORKERS_GET_CLASS (self)->finalize (self);
#line 15 "/home/jens/Source/shotwell/src/threads/Workers.vala"
g_type_free_instance ((GTypeInstance *) self);
-#line 1071 "Workers.c"
+#line 1155 "Workers.c"
}
}