/* async-launcher.c generated by valac 0.39.5, the Vala compiler
 * generated from async-launcher.vala, do not modify */

/* This file is part of GNOME Boxes. License: LGPLv2+*/

#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>
#include <gobject/gvaluecollector.h>


#define BOXES_TYPE_ASYNC_LAUNCHER (boxes_async_launcher_get_type ())
#define BOXES_ASYNC_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BOXES_TYPE_ASYNC_LAUNCHER, BoxesAsyncLauncher))
#define BOXES_ASYNC_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BOXES_TYPE_ASYNC_LAUNCHER, BoxesAsyncLauncherClass))
#define BOXES_IS_ASYNC_LAUNCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BOXES_TYPE_ASYNC_LAUNCHER))
#define BOXES_IS_ASYNC_LAUNCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BOXES_TYPE_ASYNC_LAUNCHER))
#define BOXES_ASYNC_LAUNCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BOXES_TYPE_ASYNC_LAUNCHER, BoxesAsyncLauncherClass))

typedef struct _BoxesAsyncLauncher BoxesAsyncLauncher;
typedef struct _BoxesAsyncLauncherClass BoxesAsyncLauncherClass;
typedef struct _BoxesAsyncLauncherPrivate BoxesAsyncLauncherPrivate;
#define __g_list_free__g_thread_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_thread_unref0_ (var), NULL)))
#define _boxes_async_launcher_unref0(var) ((var == NULL) ? NULL : (var = (boxes_async_launcher_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_thread_unref0(var) ((var == NULL) ? NULL : (var = (g_thread_unref (var), NULL)))
typedef struct _BoxesAsyncLauncherLaunchData BoxesAsyncLauncherLaunchData;
typedef struct _BoxesParamSpecAsyncLauncher BoxesParamSpecAsyncLauncher;

struct _BoxesAsyncLauncher {
	GTypeInstance parent_instance;
	volatile int ref_count;
	BoxesAsyncLauncherPrivate * priv;
};

struct _BoxesAsyncLauncherClass {
	GTypeClass parent_class;
	void (*finalize) (BoxesAsyncLauncher *self);
};

struct _BoxesAsyncLauncherPrivate {
	GList* all_threads;
};

typedef void (*BoxesAsyncLauncherRunInThreadFunc) (void* user_data, GError** error);
struct _Block1Data {
	int _ref_count_;
	BoxesAsyncLauncher* self;
	GError* e;
	GSourceFunc resume;
	gpointer resume_target;
	GDestroyNotify resume_target_destroy_notify;
	BoxesAsyncLauncherRunInThreadFunc func;
	gpointer func_target;
	GDestroyNotify func_target_destroy_notify;
	gpointer _async_data_;
};

struct _BoxesAsyncLauncherLaunchData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	BoxesAsyncLauncher* self;
	BoxesAsyncLauncherRunInThreadFunc func;
	gpointer func_target;
	GDestroyNotify func_target_destroy_notify;
	Block1Data* _data1_;
	GThread* thread;
	GThread* _tmp0_;
	GThread* _tmp1_;
	GThread* _tmp2_;
	GThread* _tmp3_;
	GThread* _tmp4_;
	GThread* _tmp5_;
	GError* _tmp6_;
	GError* _tmp7_;
	GError* _tmp8_;
	GError * _inner_error_;
};

struct _BoxesParamSpecAsyncLauncher {
	GParamSpec parent_instance;
};


static gpointer boxes_async_launcher_parent_class = NULL;
static BoxesAsyncLauncher* boxes_async_launcher_launcher;
static BoxesAsyncLauncher* boxes_async_launcher_launcher = NULL;

gpointer boxes_async_launcher_ref (gpointer instance);
void boxes_async_launcher_unref (gpointer instance);
GParamSpec* boxes_param_spec_async_launcher (const gchar* name,
                                             const gchar* nick,
                                             const gchar* blurb,
                                             GType object_type,
                                             GParamFlags flags);
void boxes_value_set_async_launcher (GValue* value,
                                     gpointer v_object);
void boxes_value_take_async_launcher (GValue* value,
                                      gpointer v_object);
gpointer boxes_value_get_async_launcher (const GValue* value);
GType boxes_async_launcher_get_type (void) G_GNUC_CONST;
#define BOXES_ASYNC_LAUNCHER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BOXES_TYPE_ASYNC_LAUNCHER, BoxesAsyncLauncherPrivate))
static void _g_thread_unref0_ (gpointer var);
static inline void _g_list_free__g_thread_unref0_ (GList* self);
BoxesAsyncLauncher* boxes_async_launcher_get_default (void);
static BoxesAsyncLauncher* boxes_async_launcher_new (void);
static BoxesAsyncLauncher* boxes_async_launcher_construct (GType object_type);
static void boxes_async_launcher_launch_data_free (gpointer _data);
void boxes_async_launcher_launch (BoxesAsyncLauncher* self,
                                  BoxesAsyncLauncherRunInThreadFunc func,
                                  void* func_target,
                                  GDestroyNotify func_target_destroy_notify,
                                  GAsyncReadyCallback _callback_,
                                  gpointer _user_data_);
void boxes_async_launcher_launch_finish (BoxesAsyncLauncher* self,
                                         GAsyncResult* _res_,
                                         GError** error);
static gboolean boxes_async_launcher_launch_co (BoxesAsyncLauncherLaunchData* _data_);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static gboolean _boxes_async_launcher_launch_co_gsource_func (gpointer self);
static void* __lambda4_ (Block1Data* _data1_);
static gpointer ___lambda4__gthread_func (gpointer self);
void boxes_async_launcher_await_all (BoxesAsyncLauncher* self);
static void boxes_async_launcher_finalize (BoxesAsyncLauncher * obj);


static void
_g_thread_unref0_ (gpointer var)
{
#line 8 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	(var == NULL) ? NULL : (var = (g_thread_unref (var), NULL));
#line 136 "async-launcher.c"
}


static inline void
_g_list_free__g_thread_unref0_ (GList* self)
{
#line 8 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_list_free_full (self, (GDestroyNotify) _g_thread_unref0_);
#line 145 "async-launcher.c"
}


static gpointer
_boxes_async_launcher_ref0 (gpointer self)
{
#line 14 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return self ? boxes_async_launcher_ref (self) : NULL;
#line 154 "async-launcher.c"
}


BoxesAsyncLauncher*
boxes_async_launcher_get_default (void)
{
	BoxesAsyncLauncher* result = NULL;
	BoxesAsyncLauncher* _tmp0_;
	BoxesAsyncLauncher* _tmp2_;
	BoxesAsyncLauncher* _tmp3_;
#line 11 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_tmp0_ = boxes_async_launcher_launcher;
#line 11 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (_tmp0_ == NULL) {
#line 169 "async-launcher.c"
		BoxesAsyncLauncher* _tmp1_;
#line 12 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_tmp1_ = boxes_async_launcher_new ();
#line 12 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_boxes_async_launcher_unref0 (boxes_async_launcher_launcher);
#line 12 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		boxes_async_launcher_launcher = _tmp1_;
#line 177 "async-launcher.c"
	}
#line 14 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_tmp2_ = boxes_async_launcher_launcher;
#line 14 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_tmp3_ = _boxes_async_launcher_ref0 (_tmp2_);
#line 14 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	result = _tmp3_;
#line 14 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return result;
#line 187 "async-launcher.c"
}


static BoxesAsyncLauncher*
boxes_async_launcher_construct (GType object_type)
{
	BoxesAsyncLauncher* self = NULL;
#line 17 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	self = (BoxesAsyncLauncher*) g_type_create_instance (object_type);
#line 18 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	__g_list_free__g_thread_unref0_0 (self->priv->all_threads);
#line 18 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	self->priv->all_threads = NULL;
#line 17 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return self;
#line 203 "async-launcher.c"
}


static BoxesAsyncLauncher*
boxes_async_launcher_new (void)
{
#line 17 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return boxes_async_launcher_construct (BOXES_TYPE_ASYNC_LAUNCHER);
#line 212 "async-launcher.c"
}


static void
boxes_async_launcher_launch_data_free (gpointer _data)
{
	BoxesAsyncLauncherLaunchData* _data_;
	_data_ = _data;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_boxes_async_launcher_unref0 (_data_->self);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_slice_free (BoxesAsyncLauncherLaunchData, _data_);
#line 225 "async-launcher.c"
}


void
boxes_async_launcher_launch (BoxesAsyncLauncher* self,
                             BoxesAsyncLauncherRunInThreadFunc func,
                             void* func_target,
                             GDestroyNotify func_target_destroy_notify,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_)
{
	BoxesAsyncLauncherLaunchData* _data_;
	BoxesAsyncLauncher* _tmp0_;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_ = g_slice_new0 (BoxesAsyncLauncherLaunchData);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_async_result = g_task_new (NULL, NULL, _callback_, _user_data_);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_task_set_task_data (_data_->_async_result, _data_, boxes_async_launcher_launch_data_free);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_tmp0_ = _boxes_async_launcher_ref0 (self);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->self = _tmp0_;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	(_data_->func_target_destroy_notify == NULL) ? NULL : (_data_->func_target_destroy_notify (_data_->func_target), NULL);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->func = NULL;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->func_target = NULL;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->func_target_destroy_notify = NULL;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->func = func;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->func_target = func_target;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->func_target_destroy_notify = func_target_destroy_notify;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	boxes_async_launcher_launch_co (_data_);
#line 265 "async-launcher.c"
}


void
boxes_async_launcher_launch_finish (BoxesAsyncLauncher* self,
                                    GAsyncResult* _res_,
                                    GError** error)
{
	BoxesAsyncLauncherLaunchData* _data_;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (NULL == _data_) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		return;
#line 281 "async-launcher.c"
	}
}


static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_atomic_int_inc (&_data1_->_ref_count_);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return _data1_;
#line 293 "async-launcher.c"
}


static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
#line 304 "async-launcher.c"
		BoxesAsyncLauncher* self;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		self = _data1_->self;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		(_data1_->resume_target_destroy_notify == NULL) ? NULL : (_data1_->resume_target_destroy_notify (_data1_->resume_target), NULL);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data1_->resume = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data1_->resume_target = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data1_->resume_target_destroy_notify = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_g_error_free0 (_data1_->e);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		(_data1_->func_target_destroy_notify == NULL) ? NULL : (_data1_->func_target_destroy_notify (_data1_->func_target), NULL);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data1_->func = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data1_->func_target = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data1_->func_target_destroy_notify = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_boxes_async_launcher_unref0 (self);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_slice_free (Block1Data, _data1_);
#line 330 "async-launcher.c"
	}
}


static gboolean
_boxes_async_launcher_launch_co_gsource_func (gpointer self)
{
	gboolean result;
	result = boxes_async_launcher_launch_co (self);
#line 23 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return result;
#line 342 "async-launcher.c"
}


static gpointer
_g_error_copy0 (gpointer self)
{
#line 28 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return self ? g_error_copy (self) : NULL;
#line 351 "async-launcher.c"
}


static void*
__lambda4_ (Block1Data* _data1_)
{
	BoxesAsyncLauncher* self;
	void* result = NULL;
	GSourceFunc _tmp2_;
	void* _tmp2__target;
	GDestroyNotify _tmp2__target_destroy_notify;
	GError * _inner_error_ = NULL;
#line 24 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	self = _data1_->self;
#line 366 "async-launcher.c"
	{
#line 26 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data1_->func (_data1_->func_target, &_inner_error_);
#line 26 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 372 "async-launcher.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* err = NULL;
		GError* _tmp0_;
		GError* _tmp1_;
#line 25 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		err = _inner_error_;
#line 25 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_inner_error_ = NULL;
#line 28 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_tmp0_ = err;
#line 28 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_tmp1_ = _g_error_copy0 (_tmp0_);
#line 28 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_g_error_free0 (_data1_->e);
#line 28 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data1_->e = _tmp1_;
#line 25 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_g_error_free0 (err);
#line 396 "async-launcher.c"
	}
	__finally0:
#line 25 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (G_UNLIKELY (_inner_error_ != NULL)) {
#line 25 "/home/fborges/checkout/gnome-boxes/src/async-launcher.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);
#line 25 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_clear_error (&_inner_error_);
#line 25 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		return NULL;
#line 407 "async-launcher.c"
	}
#line 31 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_tmp2_ = _data1_->resume;
#line 31 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_tmp2__target = _data1_->resume_target;
#line 31 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_tmp2__target_destroy_notify = _data1_->resume_target_destroy_notify;
#line 31 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data1_->resume = NULL;
#line 31 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data1_->resume_target = NULL;
#line 31 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data1_->resume_target_destroy_notify = NULL;
#line 31 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _tmp2_, _tmp2__target, _tmp2__target_destroy_notify);
#line 33 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	result = NULL;
#line 33 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return result;
#line 427 "async-launcher.c"
}


static gpointer
___lambda4__gthread_func (gpointer self)
{
	gpointer result;
	result = __lambda4_ (self);
#line 24 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	block1_data_unref (self);
#line 24 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return result;
#line 440 "async-launcher.c"
}


static gpointer
_g_thread_ref0 (gpointer self)
{
#line 36 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return self ? g_thread_ref (self) : NULL;
#line 449 "async-launcher.c"
}


static gboolean
boxes_async_launcher_launch_co (BoxesAsyncLauncherLaunchData* _data_)
{
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	switch (_data_->_state_) {
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		case 0:
#line 460 "async-launcher.c"
		goto _state_0;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		case 1:
#line 464 "async-launcher.c"
		goto _state_1;
		default:
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_assert_not_reached ();
#line 469 "async-launcher.c"
	}
	_state_0:
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_ = g_slice_new0 (Block1Data);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->_ref_count_ = 1;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->self = boxes_async_launcher_ref (_data_->self);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	(_data_->_data1_->func_target_destroy_notify == NULL) ? NULL : (_data_->_data1_->func_target_destroy_notify (_data_->_data1_->func_target), NULL);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->func = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->func_target = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->func_target_destroy_notify = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->func = _data_->func;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->func_target = _data_->func_target;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->func_target_destroy_notify = _data_->func_target_destroy_notify;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->_async_data_ = _data_;
#line 22 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->e = NULL;
#line 23 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->resume = _boxes_async_launcher_launch_co_gsource_func;
#line 23 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->resume_target = _data_;
#line 23 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_->resume_target_destroy_notify = NULL;
#line 24 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_tmp0_ = g_thread_new (NULL, ___lambda4__gthread_func, block1_data_ref (_data_->_data1_));
#line 24 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->thread = _data_->_tmp0_;
#line 36 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_tmp1_ = _data_->thread;
#line 36 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_tmp2_ = _g_thread_ref0 (_data_->_tmp1_);
#line 36 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->self->priv->all_threads = g_list_append (_data_->self->priv->all_threads, _data_->_tmp2_);
#line 38 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_state_ = 1;
#line 38 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return FALSE;
#line 516 "async-launcher.c"
	_state_1:
	;
#line 40 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_tmp3_ = _data_->thread;
#line 40 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_tmp4_ = _g_thread_ref0 (_data_->_tmp3_);
#line 40 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_thread_join (_data_->_tmp4_);
#line 41 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_tmp5_ = _data_->thread;
#line 41 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->self->priv->all_threads = g_list_remove (_data_->self->priv->all_threads, _data_->_tmp5_);
#line 43 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_tmp6_ = _data_->_data1_->e;
#line 43 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (_data_->_tmp6_ != NULL) {
#line 44 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data_->_tmp7_ = _data_->_data1_->e;
#line 44 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data_->_tmp8_ = _g_error_copy0 (_data_->_tmp7_);
#line 44 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data_->_inner_error_ = _data_->_tmp8_;
#line 44 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_task_return_error (_data_->_async_result, _data_->_inner_error_);
#line 44 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_g_thread_unref0 (_data_->thread);
#line 44 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		block1_data_unref (_data_->_data1_);
#line 44 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		_data_->_data1_ = NULL;
#line 44 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_object_unref (_data_->_async_result);
#line 44 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		return FALSE;
#line 551 "async-launcher.c"
	}
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_g_thread_unref0 (_data_->thread);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	block1_data_unref (_data_->_data1_);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_data_->_data1_ = NULL;
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (_data_->_state_ != 0) {
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		while (g_task_get_completed (_data_->_async_result) != TRUE) {
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
#line 567 "async-launcher.c"
		}
	}
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_object_unref (_data_->_async_result);
#line 21 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return FALSE;
#line 574 "async-launcher.c"
}


void
boxes_async_launcher_await_all (BoxesAsyncLauncher* self)
{
	GList* _tmp0_;
#line 47 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_return_if_fail (self != NULL);
#line 48 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	_tmp0_ = self->priv->all_threads;
#line 586 "async-launcher.c"
	{
		GList* thread_collection = NULL;
		GList* thread_it = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		thread_collection = _tmp0_;
#line 48 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		for (thread_it = thread_collection; thread_it != NULL; thread_it = thread_it->next) {
#line 594 "async-launcher.c"
			GThread* _tmp1_;
			GThread* thread = NULL;
#line 48 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
			_tmp1_ = _g_thread_ref0 ((GThread*) thread_it->data);
#line 48 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
			thread = _tmp1_;
#line 601 "async-launcher.c"
			{
				GThread* _tmp2_;
				GThread* _tmp3_;
#line 49 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
				_tmp2_ = thread;
#line 49 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
				_tmp3_ = _g_thread_ref0 (_tmp2_);
#line 49 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
				g_thread_join (_tmp3_);
#line 48 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
				_g_thread_unref0 (thread);
#line 613 "async-launcher.c"
			}
		}
	}
}


static void
boxes_value_async_launcher_init (GValue* value)
{
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	value->data[0].v_pointer = NULL;
#line 625 "async-launcher.c"
}


static void
boxes_value_async_launcher_free_value (GValue* value)
{
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (value->data[0].v_pointer) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		boxes_async_launcher_unref (value->data[0].v_pointer);
#line 636 "async-launcher.c"
	}
}


static void
boxes_value_async_launcher_copy_value (const GValue* src_value,
                                       GValue* dest_value)
{
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (src_value->data[0].v_pointer) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		dest_value->data[0].v_pointer = boxes_async_launcher_ref (src_value->data[0].v_pointer);
#line 649 "async-launcher.c"
	} else {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		dest_value->data[0].v_pointer = NULL;
#line 653 "async-launcher.c"
	}
}


static gpointer
boxes_value_async_launcher_peek_pointer (const GValue* value)
{
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return value->data[0].v_pointer;
#line 663 "async-launcher.c"
}


static gchar*
boxes_value_async_launcher_collect_value (GValue* value,
                                          guint n_collect_values,
                                          GTypeCValue* collect_values,
                                          guint collect_flags)
{
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (collect_values[0].v_pointer) {
#line 675 "async-launcher.c"
		BoxesAsyncLauncher * object;
		object = collect_values[0].v_pointer;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		if (object->parent_instance.g_class == NULL) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
#line 682 "async-launcher.c"
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.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 686 "async-launcher.c"
		}
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		value->data[0].v_pointer = boxes_async_launcher_ref (object);
#line 690 "async-launcher.c"
	} else {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		value->data[0].v_pointer = NULL;
#line 694 "async-launcher.c"
	}
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return NULL;
#line 698 "async-launcher.c"
}


static gchar*
boxes_value_async_launcher_lcopy_value (const GValue* value,
                                        guint n_collect_values,
                                        GTypeCValue* collect_values,
                                        guint collect_flags)
{
	BoxesAsyncLauncher ** object_p;
	object_p = collect_values[0].v_pointer;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (!object_p) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
#line 714 "async-launcher.c"
	}
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (!value->data[0].v_pointer) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		*object_p = NULL;
#line 720 "async-launcher.c"
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		*object_p = value->data[0].v_pointer;
#line 724 "async-launcher.c"
	} else {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		*object_p = boxes_async_launcher_ref (value->data[0].v_pointer);
#line 728 "async-launcher.c"
	}
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return NULL;
#line 732 "async-launcher.c"
}


GParamSpec*
boxes_param_spec_async_launcher (const gchar* name,
                                 const gchar* nick,
                                 const gchar* blurb,
                                 GType object_type,
                                 GParamFlags flags)
{
	BoxesParamSpecAsyncLauncher* spec;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_return_val_if_fail (g_type_is_a (object_type, BOXES_TYPE_ASYNC_LAUNCHER), NULL);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	G_PARAM_SPEC (spec)->value_type = object_type;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return G_PARAM_SPEC (spec);
#line 752 "async-launcher.c"
}


gpointer
boxes_value_get_async_launcher (const GValue* value)
{
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BOXES_TYPE_ASYNC_LAUNCHER), NULL);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return value->data[0].v_pointer;
#line 763 "async-launcher.c"
}


void
boxes_value_set_async_launcher (GValue* value,
                                gpointer v_object)
{
	BoxesAsyncLauncher * old;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BOXES_TYPE_ASYNC_LAUNCHER));
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	old = value->data[0].v_pointer;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (v_object) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BOXES_TYPE_ASYNC_LAUNCHER));
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		value->data[0].v_pointer = v_object;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		boxes_async_launcher_ref (value->data[0].v_pointer);
#line 786 "async-launcher.c"
	} else {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		value->data[0].v_pointer = NULL;
#line 790 "async-launcher.c"
	}
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (old) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		boxes_async_launcher_unref (old);
#line 796 "async-launcher.c"
	}
}


void
boxes_value_take_async_launcher (GValue* value,
                                 gpointer v_object)
{
	BoxesAsyncLauncher * old;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, BOXES_TYPE_ASYNC_LAUNCHER));
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	old = value->data[0].v_pointer;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (v_object) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, BOXES_TYPE_ASYNC_LAUNCHER));
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		value->data[0].v_pointer = v_object;
#line 818 "async-launcher.c"
	} else {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		value->data[0].v_pointer = NULL;
#line 822 "async-launcher.c"
	}
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (old) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		boxes_async_launcher_unref (old);
#line 828 "async-launcher.c"
	}
}


static void
boxes_async_launcher_class_init (BoxesAsyncLauncherClass * klass)
{
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	boxes_async_launcher_parent_class = g_type_class_peek_parent (klass);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	((BoxesAsyncLauncherClass *) klass)->finalize = boxes_async_launcher_finalize;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_type_class_add_private (klass, sizeof (BoxesAsyncLauncherPrivate));
#line 842 "async-launcher.c"
}


static void
boxes_async_launcher_instance_init (BoxesAsyncLauncher * self)
{
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	self->priv = BOXES_ASYNC_LAUNCHER_GET_PRIVATE (self);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	self->ref_count = 1;
#line 853 "async-launcher.c"
}


static void
boxes_async_launcher_finalize (BoxesAsyncLauncher * obj)
{
	BoxesAsyncLauncher * self;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, BOXES_TYPE_ASYNC_LAUNCHER, BoxesAsyncLauncher);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_signal_handlers_destroy (self);
#line 8 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	__g_list_free__g_thread_unref0_0 (self->priv->all_threads);
#line 867 "async-launcher.c"
}


GType
boxes_async_launcher_get_type (void)
{
	static volatile gsize boxes_async_launcher_type_id__volatile = 0;
	if (g_once_init_enter (&boxes_async_launcher_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { boxes_value_async_launcher_init, boxes_value_async_launcher_free_value, boxes_value_async_launcher_copy_value, boxes_value_async_launcher_peek_pointer, "p", boxes_value_async_launcher_collect_value, "p", boxes_value_async_launcher_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (BoxesAsyncLauncherClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) boxes_async_launcher_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (BoxesAsyncLauncher), 0, (GInstanceInitFunc) boxes_async_launcher_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType boxes_async_launcher_type_id;
		boxes_async_launcher_type_id = g_type_register_fundamental (g_type_fundamental_next (), "BoxesAsyncLauncher", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&boxes_async_launcher_type_id__volatile, boxes_async_launcher_type_id);
	}
	return boxes_async_launcher_type_id__volatile;
}


gpointer
boxes_async_launcher_ref (gpointer instance)
{
	BoxesAsyncLauncher * self;
	self = instance;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	g_atomic_int_inc (&self->ref_count);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	return instance;
#line 896 "async-launcher.c"
}


void
boxes_async_launcher_unref (gpointer instance)
{
	BoxesAsyncLauncher * self;
	self = instance;
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		BOXES_ASYNC_LAUNCHER_GET_CLASS (self)->finalize (self);
#line 3 "/home/fborges/checkout/gnome-boxes/src/async-launcher.vala"
		g_type_free_instance ((GTypeInstance *) self);
#line 911 "async-launcher.c"
	}
}



