/* nonblocking-reporting-semaphore.c generated by valac 0.56.3, the Vala compiler
 * generated from nonblocking-reporting-semaphore.vala, do not modify */

/* Copyright 2016 Software Freedom Conservancy Inc.
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

#include "geary-engine.h"
#include <glib.h>
#include <glib-object.h>
#include <gio/gio.h>

enum  {
	GEARY_NONBLOCKING_REPORTING_SEMAPHORE_0_PROPERTY,
	GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_TYPE,
	GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_DUP_FUNC,
	GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_DESTROY_FUNC,
	GEARY_NONBLOCKING_REPORTING_SEMAPHORE_RESULT_PROPERTY,
	GEARY_NONBLOCKING_REPORTING_SEMAPHORE_ERR_PROPERTY,
	GEARY_NONBLOCKING_REPORTING_SEMAPHORE_NUM_PROPERTIES
};
static GParamSpec* geary_nonblocking_reporting_semaphore_properties[GEARY_NONBLOCKING_REPORTING_SEMAPHORE_NUM_PROPERTIES];
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _GearyNonblockingReportingSemaphoreWaitForResultAsyncData GearyNonblockingReportingSemaphoreWaitForResultAsyncData;

struct _GearyNonblockingReportingSemaphorePrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	gpointer _result;
	GError* _err;
	gpointer default_result;
};

struct _GearyNonblockingReportingSemaphoreWaitForResultAsyncData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	GearyNonblockingReportingSemaphore* self;
	GCancellable* cancellable;
	gpointer result;
	gconstpointer _tmp0_;
	gpointer _tmp1_;
	GError* _inner_error0_;
};

static gint GearyNonblockingReportingSemaphore_private_offset;
static gpointer geary_nonblocking_reporting_semaphore_parent_class = NULL;

static void geary_nonblocking_reporting_semaphore_set_result (GearyNonblockingReportingSemaphore* self,
                                                       gconstpointer value);
static void geary_nonblocking_reporting_semaphore_set_err (GearyNonblockingReportingSemaphore* self,
                                                    GError* value);
static void geary_nonblocking_reporting_semaphore_real_reset (GearyNonblockingLock* base);
static void geary_nonblocking_reporting_semaphore_wait_for_result_async_data_free (gpointer _data);
static gboolean geary_nonblocking_reporting_semaphore_wait_for_result_async_co (GearyNonblockingReportingSemaphoreWaitForResultAsyncData* _data_);
static void geary_nonblocking_reporting_semaphore_wait_for_result_async_ready (GObject* source_object,
                                                                        GAsyncResult* _res_,
                                                                        gpointer _user_data_);
static void geary_nonblocking_reporting_semaphore_finalize (GObject * obj);
static GType geary_nonblocking_reporting_semaphore_get_type_once (void);
static void _vala_geary_nonblocking_reporting_semaphore_get_property (GObject * object,
                                                               guint property_id,
                                                               GValue * value,
                                                               GParamSpec * pspec);
static void _vala_geary_nonblocking_reporting_semaphore_set_property (GObject * object,
                                                               guint property_id,
                                                               const GValue * value,
                                                               GParamSpec * pspec);

static inline gpointer
geary_nonblocking_reporting_semaphore_get_instance_private (GearyNonblockingReportingSemaphore* self)
{
	return G_STRUCT_MEMBER_P (self, GearyNonblockingReportingSemaphore_private_offset);
}

gconstpointer
geary_nonblocking_reporting_semaphore_get_result (GearyNonblockingReportingSemaphore* self)
{
	gconstpointer result;
	gconstpointer _tmp0_;
	g_return_val_if_fail (GEARY_NONBLOCKING_IS_REPORTING_SEMAPHORE (self), NULL);
	_tmp0_ = self->priv->_result;
	result = _tmp0_;
	return result;
}

static void
geary_nonblocking_reporting_semaphore_set_result (GearyNonblockingReportingSemaphore* self,
                                                  gconstpointer value)
{
	gpointer old_value;
	g_return_if_fail (GEARY_NONBLOCKING_IS_REPORTING_SEMAPHORE (self));
	old_value = geary_nonblocking_reporting_semaphore_get_result (self);
	if (old_value != value) {
		gpointer _tmp0_;
		_tmp0_ = ((value != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) value) : ((gpointer) value);
		((self->priv->_result == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->priv->_result = (self->priv->g_destroy_func (self->priv->_result), NULL));
		self->priv->_result = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, geary_nonblocking_reporting_semaphore_properties[GEARY_NONBLOCKING_REPORTING_SEMAPHORE_RESULT_PROPERTY]);
	}
}

GError*
geary_nonblocking_reporting_semaphore_get_err (GearyNonblockingReportingSemaphore* self)
{
	GError* result;
	GError* _tmp0_;
	g_return_val_if_fail (GEARY_NONBLOCKING_IS_REPORTING_SEMAPHORE (self), NULL);
	_tmp0_ = self->priv->_err;
	result = _tmp0_;
	return result;
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static void
geary_nonblocking_reporting_semaphore_set_err (GearyNonblockingReportingSemaphore* self,
                                               GError* value)
{
	GError* old_value;
	g_return_if_fail (GEARY_NONBLOCKING_IS_REPORTING_SEMAPHORE (self));
	old_value = geary_nonblocking_reporting_semaphore_get_err (self);
	if (old_value != value) {
		GError* _tmp0_;
		_tmp0_ = _g_error_copy0 (value);
		_g_error_free0 (self->priv->_err);
		self->priv->_err = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, geary_nonblocking_reporting_semaphore_properties[GEARY_NONBLOCKING_REPORTING_SEMAPHORE_ERR_PROPERTY]);
	}
}

GearyNonblockingReportingSemaphore*
geary_nonblocking_reporting_semaphore_construct (GType object_type,
                                                 GType g_type,
                                                 GBoxedCopyFunc g_dup_func,
                                                 GDestroyNotify g_destroy_func,
                                                 gconstpointer default_result,
                                                 GCancellable* cancellable)
{
	GearyNonblockingReportingSemaphore * self = NULL;
	gpointer _tmp0_;
	g_return_val_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()), NULL);
	self = (GearyNonblockingReportingSemaphore*) geary_nonblocking_semaphore_construct (object_type, cancellable);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = ((default_result != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) default_result) : ((gpointer) default_result);
	((self->priv->default_result == NULL) || (g_destroy_func == NULL)) ? NULL : (self->priv->default_result = (g_destroy_func (self->priv->default_result), NULL));
	self->priv->default_result = _tmp0_;
	geary_nonblocking_reporting_semaphore_set_result (self, default_result);
	return self;
}

GearyNonblockingReportingSemaphore*
geary_nonblocking_reporting_semaphore_new (GType g_type,
                                           GBoxedCopyFunc g_dup_func,
                                           GDestroyNotify g_destroy_func,
                                           gconstpointer default_result,
                                           GCancellable* cancellable)
{
	return geary_nonblocking_reporting_semaphore_construct (GEARY_NONBLOCKING_TYPE_REPORTING_SEMAPHORE, g_type, g_dup_func, g_destroy_func, default_result, cancellable);
}

static void
geary_nonblocking_reporting_semaphore_real_reset (GearyNonblockingLock* base)
{
	GearyNonblockingReportingSemaphore * self;
	gconstpointer _tmp0_;
	self = G_TYPE_CHECK_INSTANCE_CAST (base, GEARY_NONBLOCKING_TYPE_REPORTING_SEMAPHORE, GearyNonblockingReportingSemaphore);
	_tmp0_ = self->priv->default_result;
	geary_nonblocking_reporting_semaphore_set_result (self, _tmp0_);
	geary_nonblocking_reporting_semaphore_set_err (self, NULL);
	GEARY_NONBLOCKING_LOCK_CLASS (geary_nonblocking_reporting_semaphore_parent_class)->reset (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_NONBLOCKING_TYPE_SEMAPHORE, GearyNonblockingSemaphore), GEARY_NONBLOCKING_TYPE_LOCK, GearyNonblockingLock));
}

void
geary_nonblocking_reporting_semaphore_notify_result (GearyNonblockingReportingSemaphore* self,
                                                     gconstpointer _result_,
                                                     GError* err,
                                                     GError** error)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (GEARY_NONBLOCKING_IS_REPORTING_SEMAPHORE (self));
	geary_nonblocking_reporting_semaphore_set_result (self, _result_);
	geary_nonblocking_reporting_semaphore_set_err (self, err);
	geary_nonblocking_lock_notify (G_TYPE_CHECK_INSTANCE_CAST (self, GEARY_NONBLOCKING_TYPE_LOCK, GearyNonblockingLock), &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

void
geary_nonblocking_reporting_semaphore_throw_if_error (GearyNonblockingReportingSemaphore* self,
                                                      GError** error)
{
	GError* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (GEARY_NONBLOCKING_IS_REPORTING_SEMAPHORE (self));
	_tmp0_ = self->priv->_err;
	if (_tmp0_ != NULL) {
		GError* _tmp1_;
		GError* _tmp2_;
		_tmp1_ = self->priv->_err;
		_tmp2_ = _g_error_copy0 (_tmp1_);
		_inner_error0_ = _tmp2_;
		g_propagate_error (error, _inner_error0_);
		return;
	}
}

static void
geary_nonblocking_reporting_semaphore_wait_for_result_async_data_free (gpointer _data)
{
	GearyNonblockingReportingSemaphoreWaitForResultAsyncData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->cancellable);
	((_data_->result == NULL) || (_data_->self->priv->g_destroy_func == NULL)) ? NULL : (_data_->result = (_data_->self->priv->g_destroy_func (_data_->result), NULL));
	_g_object_unref0 (_data_->self);
	g_slice_free (GearyNonblockingReportingSemaphoreWaitForResultAsyncData, _data_);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
geary_nonblocking_reporting_semaphore_wait_for_result_async (GearyNonblockingReportingSemaphore* self,
                                                             GCancellable* cancellable,
                                                             GAsyncReadyCallback _callback_,
                                                             gpointer _user_data_)
{
	GearyNonblockingReportingSemaphoreWaitForResultAsyncData* _data_;
	GearyNonblockingReportingSemaphore* _tmp0_;
	GCancellable* _tmp1_;
	g_return_if_fail (GEARY_NONBLOCKING_IS_REPORTING_SEMAPHORE (self));
	g_return_if_fail ((cancellable == NULL) || G_TYPE_CHECK_INSTANCE_TYPE (cancellable, g_cancellable_get_type ()));
	_data_ = g_slice_new0 (GearyNonblockingReportingSemaphoreWaitForResultAsyncData);
	_data_->_async_result = g_task_new (G_OBJECT (self), cancellable, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, geary_nonblocking_reporting_semaphore_wait_for_result_async_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (cancellable);
	_g_object_unref0 (_data_->cancellable);
	_data_->cancellable = _tmp1_;
	geary_nonblocking_reporting_semaphore_wait_for_result_async_co (_data_);
}

gpointer
geary_nonblocking_reporting_semaphore_wait_for_result_finish (GearyNonblockingReportingSemaphore* self,
                                                              GAsyncResult* _res_,
                                                              GError** error)
{
	gpointer result;
	GearyNonblockingReportingSemaphoreWaitForResultAsyncData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return NULL;
	}
	result = _data_->result;
	_data_->result = NULL;
	return result;
}

static void
geary_nonblocking_reporting_semaphore_wait_for_result_async_ready (GObject* source_object,
                                                                   GAsyncResult* _res_,
                                                                   gpointer _user_data_)
{
	GearyNonblockingReportingSemaphoreWaitForResultAsyncData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	geary_nonblocking_reporting_semaphore_wait_for_result_async_co (_data_);
}

static gboolean
geary_nonblocking_reporting_semaphore_wait_for_result_async_co (GearyNonblockingReportingSemaphoreWaitForResultAsyncData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	geary_nonblocking_reporting_semaphore_throw_if_error (_data_->self, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_state_ = 1;
	GEARY_NONBLOCKING_LOCK_CLASS (geary_nonblocking_reporting_semaphore_parent_class)->wait_async (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_NONBLOCKING_TYPE_SEMAPHORE, GearyNonblockingSemaphore), GEARY_NONBLOCKING_TYPE_LOCK, GearyNonblockingLock), _data_->cancellable, geary_nonblocking_reporting_semaphore_wait_for_result_async_ready, _data_);
	return FALSE;
	_state_1:
	GEARY_NONBLOCKING_LOCK_CLASS (geary_nonblocking_reporting_semaphore_parent_class)->wait_finish (G_TYPE_CHECK_INSTANCE_CAST (G_TYPE_CHECK_INSTANCE_CAST (_data_->self, GEARY_NONBLOCKING_TYPE_SEMAPHORE, GearyNonblockingSemaphore), GEARY_NONBLOCKING_TYPE_LOCK, GearyNonblockingLock), _data_->_res_, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	geary_nonblocking_reporting_semaphore_throw_if_error (_data_->self, &_data_->_inner_error0_);
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->_tmp0_ = _data_->self->priv->_result;
	_data_->_tmp1_ = ((_data_->_tmp0_ != NULL) && (_data_->self->priv->g_dup_func != NULL)) ? _data_->self->priv->g_dup_func ((gpointer) _data_->_tmp0_) : ((gpointer) _data_->_tmp0_);
	_data_->result = _data_->_tmp1_;
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
geary_nonblocking_reporting_semaphore_class_init (GearyNonblockingReportingSemaphoreClass * klass,
                                                  gpointer klass_data)
{
	geary_nonblocking_reporting_semaphore_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GearyNonblockingReportingSemaphore_private_offset);
	((GearyNonblockingLockClass *) klass)->reset = (void (*) (GearyNonblockingLock*)) geary_nonblocking_reporting_semaphore_real_reset;
	G_OBJECT_CLASS (klass)->get_property = _vala_geary_nonblocking_reporting_semaphore_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_geary_nonblocking_reporting_semaphore_set_property;
	G_OBJECT_CLASS (klass)->finalize = geary_nonblocking_reporting_semaphore_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_NONBLOCKING_REPORTING_SEMAPHORE_RESULT_PROPERTY, geary_nonblocking_reporting_semaphore_properties[GEARY_NONBLOCKING_REPORTING_SEMAPHORE_RESULT_PROPERTY] = g_param_spec_pointer ("result", "result", "result", G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEARY_NONBLOCKING_REPORTING_SEMAPHORE_ERR_PROPERTY, geary_nonblocking_reporting_semaphore_properties[GEARY_NONBLOCKING_REPORTING_SEMAPHORE_ERR_PROPERTY] = g_param_spec_boxed ("err", "err", "err", G_TYPE_ERROR, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
geary_nonblocking_reporting_semaphore_instance_init (GearyNonblockingReportingSemaphore * self,
                                                     gpointer klass)
{
	self->priv = geary_nonblocking_reporting_semaphore_get_instance_private (self);
	self->priv->_err = NULL;
}

static void
geary_nonblocking_reporting_semaphore_finalize (GObject * obj)
{
	GearyNonblockingReportingSemaphore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEARY_NONBLOCKING_TYPE_REPORTING_SEMAPHORE, GearyNonblockingReportingSemaphore);
	((self->priv->_result == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->priv->_result = (self->priv->g_destroy_func (self->priv->_result), NULL));
	_g_error_free0 (self->priv->_err);
	((self->priv->default_result == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (self->priv->default_result = (self->priv->g_destroy_func (self->priv->default_result), NULL));
	G_OBJECT_CLASS (geary_nonblocking_reporting_semaphore_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
geary_nonblocking_reporting_semaphore_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GearyNonblockingReportingSemaphoreClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) geary_nonblocking_reporting_semaphore_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GearyNonblockingReportingSemaphore), 0, (GInstanceInitFunc) geary_nonblocking_reporting_semaphore_instance_init, NULL };
	GType geary_nonblocking_reporting_semaphore_type_id;
	geary_nonblocking_reporting_semaphore_type_id = g_type_register_static (GEARY_NONBLOCKING_TYPE_SEMAPHORE, "GearyNonblockingReportingSemaphore", &g_define_type_info, 0);
	GearyNonblockingReportingSemaphore_private_offset = g_type_add_instance_private (geary_nonblocking_reporting_semaphore_type_id, sizeof (GearyNonblockingReportingSemaphorePrivate));
	return geary_nonblocking_reporting_semaphore_type_id;
}

GType
geary_nonblocking_reporting_semaphore_get_type (void)
{
	static gsize geary_nonblocking_reporting_semaphore_type_id__once = 0;
	if (g_once_init_enter (&geary_nonblocking_reporting_semaphore_type_id__once)) {
		GType geary_nonblocking_reporting_semaphore_type_id;
		geary_nonblocking_reporting_semaphore_type_id = geary_nonblocking_reporting_semaphore_get_type_once ();
		g_once_init_leave (&geary_nonblocking_reporting_semaphore_type_id__once, geary_nonblocking_reporting_semaphore_type_id);
	}
	return geary_nonblocking_reporting_semaphore_type_id__once;
}

static void
_vala_geary_nonblocking_reporting_semaphore_get_property (GObject * object,
                                                          guint property_id,
                                                          GValue * value,
                                                          GParamSpec * pspec)
{
	GearyNonblockingReportingSemaphore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEARY_NONBLOCKING_TYPE_REPORTING_SEMAPHORE, GearyNonblockingReportingSemaphore);
	switch (property_id) {
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_RESULT_PROPERTY:
		g_value_set_pointer (value, geary_nonblocking_reporting_semaphore_get_result (self));
		break;
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_ERR_PROPERTY:
		g_value_set_pointer (value, geary_nonblocking_reporting_semaphore_get_err (self));
		break;
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_TYPE:
		g_value_set_gtype (value, self->priv->g_type);
		break;
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_DUP_FUNC:
		g_value_set_pointer (value, self->priv->g_dup_func);
		break;
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_DESTROY_FUNC:
		g_value_set_pointer (value, self->priv->g_destroy_func);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_geary_nonblocking_reporting_semaphore_set_property (GObject * object,
                                                          guint property_id,
                                                          const GValue * value,
                                                          GParamSpec * pspec)
{
	GearyNonblockingReportingSemaphore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEARY_NONBLOCKING_TYPE_REPORTING_SEMAPHORE, GearyNonblockingReportingSemaphore);
	switch (property_id) {
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_RESULT_PROPERTY:
		geary_nonblocking_reporting_semaphore_set_result (self, g_value_get_pointer (value));
		break;
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_ERR_PROPERTY:
		geary_nonblocking_reporting_semaphore_set_err (self, g_value_get_pointer (value));
		break;
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEARY_NONBLOCKING_REPORTING_SEMAPHORE_G_DESTROY_FUNC:
		self->priv->g_destroy_func = g_value_get_pointer (value);
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

