/* concurrentlist.c generated by valac 0.56.17, the Vala compiler
 * generated from concurrentlist.vala, do not modify */

/* concurrentlist.vala
 *
 * Copyright (C) 2011-2014  Maciej Piechotka
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Maciej Piechotka <uzytkownik2@gmail.com>
 */

#include "gee.h"
#include <glib-object.h>
#include <glib.h>
#include <misc.h>
#include <gobject/gvaluecollector.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define GEE_CONCURRENT_LIST_TYPE_NODE (gee_concurrent_list_node_get_type ())
#define GEE_CONCURRENT_LIST_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_CONCURRENT_LIST_TYPE_NODE, GeeConcurrentListNode))
#define GEE_CONCURRENT_LIST_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_CONCURRENT_LIST_TYPE_NODE, GeeConcurrentListNodeClass))
#define GEE_CONCURRENT_LIST_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_CONCURRENT_LIST_TYPE_NODE))
#define GEE_CONCURRENT_LIST_IS_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_CONCURRENT_LIST_TYPE_NODE))
#define GEE_CONCURRENT_LIST_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_CONCURRENT_LIST_TYPE_NODE, GeeConcurrentListNodeClass))

typedef struct _GeeConcurrentListNode GeeConcurrentListNode;
typedef struct _GeeConcurrentListNodeClass GeeConcurrentListNodeClass;

#define GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE (gee_functions_equal_data_func_closure_get_type ())
#define GEE_FUNCTIONS_EQUAL_DATA_FUNC_CLOSURE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE, GeeFunctionsEqualDataFuncClosure))
#define GEE_FUNCTIONS_EQUAL_DATA_FUNC_CLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE, GeeFunctionsEqualDataFuncClosureClass))
#define GEE_FUNCTIONS_IS_EQUAL_DATA_FUNC_CLOSURE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE))
#define GEE_FUNCTIONS_IS_EQUAL_DATA_FUNC_CLOSURE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE))
#define GEE_FUNCTIONS_EQUAL_DATA_FUNC_CLOSURE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_FUNCTIONS_TYPE_EQUAL_DATA_FUNC_CLOSURE, GeeFunctionsEqualDataFuncClosureClass))

typedef struct _GeeFunctionsEqualDataFuncClosure GeeFunctionsEqualDataFuncClosure;
typedef struct _GeeFunctionsEqualDataFuncClosureClass GeeFunctionsEqualDataFuncClosureClass;
enum  {
	GEE_CONCURRENT_LIST_0_PROPERTY,
	GEE_CONCURRENT_LIST_G_TYPE,
	GEE_CONCURRENT_LIST_G_DUP_FUNC,
	GEE_CONCURRENT_LIST_G_DESTROY_FUNC,
	GEE_CONCURRENT_LIST_READ_ONLY_PROPERTY,
	GEE_CONCURRENT_LIST_SIZE_PROPERTY,
	GEE_CONCURRENT_LIST_IS_EMPTY_PROPERTY,
	GEE_CONCURRENT_LIST_NUM_PROPERTIES
};
static GParamSpec* gee_concurrent_list_properties[GEE_CONCURRENT_LIST_NUM_PROPERTIES];
#define _gee_concurrent_list_node_unref0(var) ((var == NULL) ? NULL : (var = (gee_concurrent_list_node_unref (var), NULL)))
#define _gee_hazard_pointer_context_free0(var) ((var == NULL) ? NULL : (var = (gee_hazard_pointer_context_free (var), NULL)))
typedef enum  {
	GEE_CONCURRENT_LIST_STATE_NONE = 0,
	GEE_CONCURRENT_LIST_STATE_MARKED = 1,
	GEE_CONCURRENT_LIST_STATE_FLAGGED = 2
} GeeConcurrentListState;

#define GEE_CONCURRENT_LIST_TYPE_STATE (gee_concurrent_list_state_get_type ())
#define _gee_functions_equal_data_func_closure_unref0(var) ((var == NULL) ? NULL : (var = (gee_functions_equal_data_func_closure_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GEE_CONCURRENT_LIST_TYPE_ITERATOR (gee_concurrent_list_iterator_get_type ())
#define GEE_CONCURRENT_LIST_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIterator))
#define GEE_CONCURRENT_LIST_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIteratorClass))
#define GEE_CONCURRENT_LIST_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_CONCURRENT_LIST_TYPE_ITERATOR))
#define GEE_CONCURRENT_LIST_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_CONCURRENT_LIST_TYPE_ITERATOR))
#define GEE_CONCURRENT_LIST_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIteratorClass))

typedef struct _GeeConcurrentListIterator GeeConcurrentListIterator;
typedef struct _GeeConcurrentListIteratorClass GeeConcurrentListIteratorClass;
typedef struct _GeeFunctionsEqualDataFuncClosurePrivate GeeFunctionsEqualDataFuncClosurePrivate;
typedef struct _GeeConcurrentListIteratorPrivate GeeConcurrentListIteratorPrivate;
enum  {
	GEE_CONCURRENT_LIST_ITERATOR_0_PROPERTY,
	GEE_CONCURRENT_LIST_ITERATOR_G_TYPE,
	GEE_CONCURRENT_LIST_ITERATOR_G_DUP_FUNC,
	GEE_CONCURRENT_LIST_ITERATOR_G_DESTROY_FUNC,
	GEE_CONCURRENT_LIST_ITERATOR_VALID_PROPERTY,
	GEE_CONCURRENT_LIST_ITERATOR_READ_ONLY_PROPERTY,
	GEE_CONCURRENT_LIST_ITERATOR_NUM_PROPERTIES
};
static GParamSpec* gee_concurrent_list_iterator_properties[GEE_CONCURRENT_LIST_ITERATOR_NUM_PROPERTIES];
typedef struct _GeeConcurrentListNodePrivate GeeConcurrentListNodePrivate;
typedef struct _GeeConcurrentListParamSpecNode GeeConcurrentListParamSpecNode;
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GeeConcurrentListPrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
	GeeConcurrentListNode* _head;
	GeeConcurrentListNode* _tail;
	GeeFunctionsEqualDataFuncClosure* _equal_func;
};

struct _GeeFunctionsEqualDataFuncClosure {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GeeFunctionsEqualDataFuncClosurePrivate * priv;
	GeeEqualDataFunc func;
	gpointer func_target;
	GDestroyNotify func_target_destroy_notify;
};

struct _GeeFunctionsEqualDataFuncClosureClass {
	GTypeClass parent_class;
	void (*finalize) (GeeFunctionsEqualDataFuncClosure *self);
};

struct _GeeConcurrentListIterator {
	GObject parent_instance;
	GeeConcurrentListIteratorPrivate * priv;
	gboolean _removed;
	gint _index;
	GeeConcurrentListNode* _prev;
	GeeConcurrentListNode* _curr;
};

struct _GeeConcurrentListIteratorClass {
	GObjectClass parent_class;
};

struct _GeeConcurrentListIteratorPrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};

struct _GeeConcurrentListNode {
	GTypeInstance parent_instance;
	volatile int ref_count;
	GeeConcurrentListNodePrivate * priv;
	GeeConcurrentListNode* _succ;
	GeeConcurrentListNode* _backlink;
	gconstpointer* _data;
};

struct _GeeConcurrentListNodeClass {
	GTypeClass parent_class;
	void (*finalize) (GeeConcurrentListNode *self);
};

struct _GeeConcurrentListNodePrivate {
	GType g_type;
	GBoxedCopyFunc g_dup_func;
	GDestroyNotify g_destroy_func;
};

struct _GeeConcurrentListParamSpecNode {
	GParamSpec parent_instance;
};

static gint GeeConcurrentList_private_offset;
static gpointer gee_concurrent_list_parent_class = NULL;
static gint GeeConcurrentListIterator_private_offset;
static gpointer gee_concurrent_list_iterator_parent_class = NULL;
static GeeTraversableIface * gee_concurrent_list_iterator_gee_traversable_parent_iface = NULL;
static GeeIteratorIface * gee_concurrent_list_iterator_gee_iterator_parent_iface = NULL;
static GeeListIteratorIface * gee_concurrent_list_iterator_gee_list_iterator_parent_iface = NULL;
static gint GeeConcurrentListNode_private_offset;
static gpointer gee_concurrent_list_node_parent_class = NULL;

static gpointer gee_concurrent_list_node_ref (gpointer instance);
static void gee_concurrent_list_node_unref (gpointer instance);
static GParamSpec* gee_concurrent_list_param_spec_node (const gchar* name,
                                                 const gchar* nick,
                                                 const gchar* blurb,
                                                 GType object_type,
                                                 GParamFlags flags) G_GNUC_UNUSED ;
static void gee_concurrent_list_value_set_node (GValue* value,
                                         gpointer v_object) G_GNUC_UNUSED ;
static void gee_concurrent_list_value_take_node (GValue* value,
                                          gpointer v_object) G_GNUC_UNUSED ;
static gpointer gee_concurrent_list_value_get_node (const GValue* value) G_GNUC_UNUSED ;
static GType gee_concurrent_list_node_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
 G_GNUC_INTERNAL gpointer gee_functions_equal_data_func_closure_ref (gpointer instance);
 G_GNUC_INTERNAL void gee_functions_equal_data_func_closure_unref (gpointer instance);
 G_GNUC_INTERNAL GParamSpec* gee_functions_param_spec_equal_data_func_closure (const gchar* name,
                                                              const gchar* nick,
                                                              const gchar* blurb,
                                                              GType object_type,
                                                              GParamFlags flags);
 G_GNUC_INTERNAL void gee_functions_value_set_equal_data_func_closure (GValue* value,
                                                      gpointer v_object) G_GNUC_UNUSED ;
 G_GNUC_INTERNAL void gee_functions_value_take_equal_data_func_closure (GValue* value,
                                                       gpointer v_object);
 G_GNUC_INTERNAL gpointer gee_functions_value_get_equal_data_func_closure (const GValue* value) G_GNUC_UNUSED ;
 G_GNUC_INTERNAL GType gee_functions_equal_data_func_closure_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GType gee_concurrent_list_state_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
 G_GNUC_INTERNAL GeeFunctionsEqualDataFuncClosure* gee_functions_equal_data_func_closure_new (GType g_type,
                                                                             GBoxedCopyFunc g_dup_func,
                                                                             GDestroyNotify g_destroy_func,
                                                                             GeeEqualDataFunc func,
                                                                             gpointer func_target,
                                                                             GDestroyNotify func_target_destroy_notify);
 G_GNUC_INTERNAL GeeFunctionsEqualDataFuncClosure* gee_functions_equal_data_func_closure_construct (GType object_type,
                                                                                   GType g_type,
                                                                                   GBoxedCopyFunc g_dup_func,
                                                                                   GDestroyNotify g_destroy_func,
                                                                                   GeeEqualDataFunc func,
                                                                                   gpointer func_target,
                                                                                   GDestroyNotify func_target_destroy_notify);
static GeeConcurrentListNode* gee_concurrent_list_node_new_head (GType g_type,
                                                          GBoxedCopyFunc g_dup_func,
                                                          GDestroyNotify g_destroy_func);
static GeeConcurrentListNode* gee_concurrent_list_node_construct_head (GType object_type,
                                                                GType g_type,
                                                                GBoxedCopyFunc g_dup_func,
                                                                GDestroyNotify g_destroy_func);
 G_GNUC_INTERNAL GeeConcurrentList* gee_concurrent_list_new_with_closure (GType g_type,
                                                         GBoxedCopyFunc g_dup_func,
                                                         GDestroyNotify g_destroy_func,
                                                         GeeFunctionsEqualDataFuncClosure* equal_func);
 G_GNUC_INTERNAL GeeConcurrentList* gee_concurrent_list_construct_with_closure (GType object_type,
                                                               GType g_type,
                                                               GBoxedCopyFunc g_dup_func,
                                                               GDestroyNotify g_destroy_func,
                                                               GeeFunctionsEqualDataFuncClosure* equal_func);
static gboolean gee_concurrent_list_real_contains (GeeAbstractCollection* base,
                                            gconstpointer item);
static gboolean gee_concurrent_list_real_add (GeeAbstractCollection* base,
                                       gconstpointer item);
static GeeConcurrentListNode* gee_concurrent_list_node_new (GType g_type,
                                                     GBoxedCopyFunc g_dup_func,
                                                     GDestroyNotify g_destroy_func,
                                                     gconstpointer data);
static GeeConcurrentListNode* gee_concurrent_list_node_construct (GType object_type,
                                                           GType g_type,
                                                           GBoxedCopyFunc g_dup_func,
                                                           GDestroyNotify g_destroy_func,
                                                           gconstpointer data);
static inline void gee_concurrent_list_node_insert (GeeConcurrentListNode* self,
                                      GeeConcurrentListNode* prev,
                                      GeeConcurrentListNode* next);
static inline GeeConcurrentListNode* gee_concurrent_list_get_tail (GeeConcurrentList* self);
static gboolean gee_concurrent_list_real_remove (GeeAbstractCollection* base,
                                          gconstpointer item);
static void gee_concurrent_list_real_clear (GeeAbstractCollection* base);
static GeeIterator* gee_concurrent_list_real_iterator (GeeAbstractCollection* base);
static GeeConcurrentListIterator* gee_concurrent_list_iterator_new (GType g_type,
                                                             GBoxedCopyFunc g_dup_func,
                                                             GDestroyNotify g_destroy_func,
                                                             GeeConcurrentListNode* head);
static GeeConcurrentListIterator* gee_concurrent_list_iterator_construct (GType object_type,
                                                                   GType g_type,
                                                                   GBoxedCopyFunc g_dup_func,
                                                                   GDestroyNotify g_destroy_func,
                                                                   GeeConcurrentListNode* head);
static GType gee_concurrent_list_iterator_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static GeeListIterator* gee_concurrent_list_real_list_iterator (GeeAbstractList* base);
static gpointer gee_concurrent_list_real_get (GeeAbstractList* base,
                                       gint index);
static void gee_concurrent_list_real_set (GeeAbstractList* base,
                                   gint index,
                                   gconstpointer item);
static gint gee_concurrent_list_real_index_of (GeeAbstractList* base,
                                        gconstpointer item);
static void gee_concurrent_list_real_insert (GeeAbstractList* base,
                                      gint index,
                                      gconstpointer item);
static inline GeeConcurrentListNode* gee_concurrent_list_node_get_next (GeeConcurrentListNode* self);
static gpointer gee_concurrent_list_real_remove_at (GeeAbstractList* base,
                                             gint index);
static GeeList* gee_concurrent_list_real_slice (GeeAbstractList* base,
                                         gint start,
                                         gint end);
static inline GeeConcurrentListNode* gee_concurrent_list_update_tail (GeeConcurrentList* self);
static inline void gee_concurrent_list_node_backtrace (GType g_type,
                                         GBoxedCopyFunc g_dup_func,
                                         GDestroyNotify g_destroy_func,
                                         GeeConcurrentListNode** curr);
static inline gboolean gee_concurrent_list_node_search_for (GType g_type,
                                              GBoxedCopyFunc g_dup_func,
                                              GDestroyNotify g_destroy_func,
                                              GeeConcurrentListNode* goal,
                                              GeeConcurrentListNode** prev);
static void gee_concurrent_list_set_equal_func (GeeConcurrentList* self,
                                         GeeEqualDataFunc value,
                                         gpointer value_target);
static GeeConcurrentListIterator* gee_concurrent_list_iterator_new_from_iterator (GType g_type,
                                                                           GBoxedCopyFunc g_dup_func,
                                                                           GDestroyNotify g_destroy_func,
                                                                           GeeConcurrentListIterator* iter);
static GeeConcurrentListIterator* gee_concurrent_list_iterator_construct_from_iterator (GType object_type,
                                                                                 GType g_type,
                                                                                 GBoxedCopyFunc g_dup_func,
                                                                                 GDestroyNotify g_destroy_func,
                                                                                 GeeConcurrentListIterator* iter);
static gboolean gee_concurrent_list_iterator_real_next (GeeIterator* base);
static inline gboolean gee_concurrent_list_node_proceed (GType g_type,
                                           GBoxedCopyFunc g_dup_func,
                                           GDestroyNotify g_destroy_func,
                                           GeeConcurrentListNode** prev,
                                           GeeConcurrentListNode** curr,
                                           gboolean force);
static gboolean gee_concurrent_list_iterator_real_has_next (GeeIterator* base);
static gpointer gee_concurrent_list_iterator_real_get (GeeIterator* base);
static void gee_concurrent_list_iterator_real_set (GeeListIterator* base,
                                            gconstpointer item);
static void gee_concurrent_list_iterator_real_remove (GeeIterator* base);
static inline gboolean gee_concurrent_list_node_remove (GeeConcurrentListNode* self,
                                          GeeConcurrentListNode* prev_node);
static gint gee_concurrent_list_iterator_real_index (GeeListIterator* base);
static void gee_concurrent_list_iterator_real_add (GeeListIterator* base,
                                            gconstpointer item);
static gboolean gee_concurrent_list_iterator_real_foreach (GeeTraversable* base,
                                                    GeeForallFunc f,
                                                    gpointer f_target);
static GeeIterator** gee_concurrent_list_iterator_real_tee (GeeTraversable* base,
                                                     guint forks,
                                                     gint* result_length1);
static void gee_concurrent_list_iterator_finalize (GObject * obj);
static GType gee_concurrent_list_iterator_get_type_once (void);
static void _vala_gee_concurrent_list_iterator_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void _vala_gee_concurrent_list_iterator_set_property (GObject * object,
                                                      guint property_id,
                                                      const GValue * value,
                                                      GParamSpec * pspec);
static inline GeeConcurrentListState gee_concurrent_list_node_get_state (GeeConcurrentListNode* self);
static inline GeeConcurrentListNode* gee_concurrent_list_node_get_succ (GeeConcurrentListNode* self,
                                                          GeeConcurrentListState* state);
static inline void gee_concurrent_list_node_help_marked (GeeConcurrentListNode* self,
                                           GeeConcurrentListNode* prev_node);
static inline gboolean gee_concurrent_list_node_try_flag (GeeConcurrentListNode* self,
                                            GeeConcurrentListNode** prev_node);
static inline void gee_concurrent_list_node_help_flagged (GeeConcurrentListNode* self,
                                            GeeConcurrentListNode* prev);
static inline void gee_concurrent_list_node_set_succ (GeeConcurrentListNode* self,
                                        GeeConcurrentListNode* next,
                                        GeeConcurrentListState state);
static inline gboolean gee_concurrent_list_node_compare_and_exchange (GeeConcurrentListNode* self,
                                                        GeeConcurrentListNode* old_node,
                                                        GeeConcurrentListState old_state,
                                                        GeeConcurrentListNode* new_node,
                                                        GeeConcurrentListState new_state);
static inline void gee_concurrent_list_node_set_backlink (GeeConcurrentListNode* self,
                                            GeeConcurrentListNode* backlink);
static inline void gee_concurrent_list_node_try_mark (GeeConcurrentListNode* self);
static inline gboolean gee_concurrent_list_node_compare_succ (GeeConcurrentListNode* self,
                                                GeeConcurrentListNode* next,
                                                GeeConcurrentListState state);
static inline GeeConcurrentListNode* gee_concurrent_list_node_get_backlink (GeeConcurrentListNode* self);
static void gee_concurrent_list_node_finalize (GeeConcurrentListNode * obj);
static GType gee_concurrent_list_node_get_type_once (void);
static void gee_concurrent_list_finalize (GObject * obj);
static GType gee_concurrent_list_get_type_once (void);
static void _vala_gee_concurrent_list_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_gee_concurrent_list_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
gee_concurrent_list_get_instance_private (GeeConcurrentList* self)
{
	return G_STRUCT_MEMBER_P (self, GeeConcurrentList_private_offset);
}

static GType
gee_concurrent_list_state_get_type_once (void)
{
	static const GEnumValue values[] = {{GEE_CONCURRENT_LIST_STATE_NONE, "GEE_CONCURRENT_LIST_STATE_NONE", "none"}, {GEE_CONCURRENT_LIST_STATE_MARKED, "GEE_CONCURRENT_LIST_STATE_MARKED", "marked"}, {GEE_CONCURRENT_LIST_STATE_FLAGGED, "GEE_CONCURRENT_LIST_STATE_FLAGGED", "flagged"}, {0, NULL, NULL}};
	GType gee_concurrent_list_state_type_id;
	gee_concurrent_list_state_type_id = g_enum_register_static ("GeeConcurrentListState", values);
	return gee_concurrent_list_state_type_id;
}

static GType
gee_concurrent_list_state_get_type (void)
{
	static volatile gsize gee_concurrent_list_state_type_id__once = 0;
	if (g_once_init_enter (&gee_concurrent_list_state_type_id__once)) {
		GType gee_concurrent_list_state_type_id;
		gee_concurrent_list_state_type_id = gee_concurrent_list_state_get_type_once ();
		g_once_init_leave (&gee_concurrent_list_state_type_id__once, gee_concurrent_list_state_type_id);
	}
	return gee_concurrent_list_state_type_id__once;
}

/**
 * Construct new, empty single linked list
 *
 * If not provided, the function parameter is requested to the
 * {@link Functions} function factory methods.
 *
 * @param equal_func an optional element equality testing function
 */
static gpointer
_gee_concurrent_list_node_ref0 (gpointer self)
{
	return self ? gee_concurrent_list_node_ref (self) : NULL;
}

GeeConcurrentList*
gee_concurrent_list_construct (GType object_type,
                               GType g_type,
                               GBoxedCopyFunc g_dup_func,
                               GDestroyNotify g_destroy_func,
                               GeeEqualDataFunc equal_func,
                               gpointer equal_func_target,
                               GDestroyNotify equal_func_target_destroy_notify)
{
	GeeConcurrentList * self = NULL;
	GeeEqualDataFunc _tmp3_;
	gpointer _tmp3__target;
	GDestroyNotify _tmp3__target_destroy_notify;
	GeeFunctionsEqualDataFuncClosure* _tmp4_;
	GeeConcurrentListNode* _tmp5_;
	GeeConcurrentListNode* _tmp6_;
	GeeConcurrentListNode* _tmp7_;
	self = (GeeConcurrentList*) gee_abstract_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	if (equal_func == NULL) {
		gpointer _tmp0_ = NULL;
		GDestroyNotify _tmp1_ = NULL;
		GeeEqualDataFunc _tmp2_;
		_tmp2_ = gee_functions_get_equal_func_for (g_type, &_tmp0_, &_tmp1_);
		(equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
		equal_func = NULL;
		equal_func_target = NULL;
		equal_func_target_destroy_notify = NULL;
		equal_func = _tmp2_;
		equal_func_target = _tmp0_;
		equal_func_target_destroy_notify = _tmp1_;
	}
	_tmp3_ = equal_func;
	_tmp3__target = equal_func_target;
	_tmp3__target_destroy_notify = equal_func_target_destroy_notify;
	equal_func = NULL;
	equal_func_target = NULL;
	equal_func_target_destroy_notify = NULL;
	_tmp4_ = gee_functions_equal_data_func_closure_new (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, _tmp3_, _tmp3__target, _tmp3__target_destroy_notify);
	_gee_functions_equal_data_func_closure_unref0 (self->priv->_equal_func);
	self->priv->_equal_func = _tmp4_;
	_tmp5_ = gee_concurrent_list_node_new_head (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func);
	_gee_concurrent_list_node_unref0 (self->priv->_head);
	self->priv->_head = _tmp5_;
	_tmp6_ = self->priv->_head;
	_tmp7_ = _gee_concurrent_list_node_ref0 (_tmp6_);
	gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->priv->_tail, _tmp7_, (gsize) 0, (gsize) 0);
	(equal_func_target_destroy_notify == NULL) ? NULL : (equal_func_target_destroy_notify (equal_func_target), NULL);
	equal_func = NULL;
	equal_func_target = NULL;
	equal_func_target_destroy_notify = NULL;
	return self;
}

GeeConcurrentList*
gee_concurrent_list_new (GType g_type,
                         GBoxedCopyFunc g_dup_func,
                         GDestroyNotify g_destroy_func,
                         GeeEqualDataFunc equal_func,
                         gpointer equal_func_target,
                         GDestroyNotify equal_func_target_destroy_notify)
{
	return gee_concurrent_list_construct (GEE_TYPE_CONCURRENT_LIST, g_type, g_dup_func, g_destroy_func, equal_func, equal_func_target, equal_func_target_destroy_notify);
}

 G_GNUC_INTERNAL GeeConcurrentList*
gee_concurrent_list_construct_with_closure (GType object_type,
                                            GType g_type,
                                            GBoxedCopyFunc g_dup_func,
                                            GDestroyNotify g_destroy_func,
                                            GeeFunctionsEqualDataFuncClosure* equal_func)
{
	GeeConcurrentList * self = NULL;
	GeeFunctionsEqualDataFuncClosure* _tmp0_;
	GeeConcurrentListNode* _tmp1_;
	GeeConcurrentListNode* _tmp2_;
	GeeConcurrentListNode* _tmp3_;
	g_return_val_if_fail (equal_func != NULL, NULL);
	self = (GeeConcurrentList*) gee_abstract_list_construct (object_type, g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	_tmp0_ = equal_func;
	equal_func = NULL;
	_gee_functions_equal_data_func_closure_unref0 (self->priv->_equal_func);
	self->priv->_equal_func = _tmp0_;
	_tmp1_ = gee_concurrent_list_node_new_head (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func);
	_gee_concurrent_list_node_unref0 (self->priv->_head);
	self->priv->_head = _tmp1_;
	_tmp2_ = self->priv->_head;
	_tmp3_ = _gee_concurrent_list_node_ref0 (_tmp2_);
	gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->priv->_tail, _tmp3_, (gsize) 0, (gsize) 0);
	_gee_functions_equal_data_func_closure_unref0 (equal_func);
	return self;
}

 G_GNUC_INTERNAL GeeConcurrentList*
gee_concurrent_list_new_with_closure (GType g_type,
                                      GBoxedCopyFunc g_dup_func,
                                      GDestroyNotify g_destroy_func,
                                      GeeFunctionsEqualDataFuncClosure* equal_func)
{
	return gee_concurrent_list_construct_with_closure (GEE_TYPE_CONCURRENT_LIST, g_type, g_dup_func, g_destroy_func, equal_func);
}

/**
 * {@inheritDoc}
 */
static gboolean
gee_concurrent_list_real_contains (GeeAbstractCollection* base,
                                   gconstpointer item)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	gboolean result;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	{
		GeeIterator* iter = NULL;
		GeeIterator* _tmp2_;
		_tmp2_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
		iter = _tmp2_;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GeeIterator* _tmp4_;
				GeeEqualDataFunc _tmp5_ = NULL;
				gpointer _tmp5__target = NULL;
				GeeEqualDataFunc _tmp6_;
				gpointer _tmp6__target;
				GeeIterator* _tmp7_;
				gpointer _tmp8_;
				gpointer _tmp9_;
				gboolean _tmp10_;
				if (!_tmp3_) {
				}
				_tmp3_ = FALSE;
				_tmp4_ = iter;
				if (!gee_iterator_next (_tmp4_)) {
					break;
				}
				_tmp5_ = gee_concurrent_list_get_equal_func (self, &_tmp5__target);
				_tmp6_ = _tmp5_;
				_tmp6__target = _tmp5__target;
				_tmp7_ = iter;
				_tmp8_ = gee_iterator_get (_tmp7_);
				_tmp9_ = _tmp8_;
				_tmp10_ = _tmp6_ (item, _tmp9_, _tmp6__target);
				((_tmp9_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp9_ = (self->priv->g_destroy_func (_tmp9_), NULL));
				if (_tmp10_) {
					result = TRUE;
					_g_object_unref0 (iter);
					_gee_hazard_pointer_context_free0 (ctx);
					return result;
				}
			}
		}
		_g_object_unref0 (iter);
	}
	result = FALSE;
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

/**
 * {@inheritDoc}
 */
static gboolean
gee_concurrent_list_real_add (GeeAbstractCollection* base,
                              gconstpointer item)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeConcurrentListNode* node = NULL;
	GeeConcurrentListNode* _tmp1_;
	GeeConcurrentListNode* _tmp2_;
	gboolean result;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	gee_utils_misc_unused (ctx);
	_tmp1_ = gee_concurrent_list_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, item);
	node = _tmp1_;
	_tmp2_ = gee_concurrent_list_get_tail (self);
	gee_concurrent_list_node_insert (node, _tmp2_, NULL);
	result = TRUE;
	_gee_concurrent_list_node_unref0 (node);
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

/**
 * {@inheritDoc}
 */
static gboolean
gee_concurrent_list_real_remove (GeeAbstractCollection* base,
                                 gconstpointer item)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	GeeIterator* iter = NULL;
	GeeIterator* _tmp2_;
	gboolean result;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_tmp2_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
	iter = _tmp2_;
	while (TRUE) {
		GeeIterator* _tmp3_;
		GeeEqualDataFunc _tmp4_ = NULL;
		gpointer _tmp4__target = NULL;
		GeeEqualDataFunc _tmp5_;
		gpointer _tmp5__target;
		GeeIterator* _tmp6_;
		gpointer _tmp7_;
		gpointer _tmp8_;
		gboolean _tmp9_;
		_tmp3_ = iter;
		if (!gee_iterator_next (_tmp3_)) {
			break;
		}
		_tmp4_ = gee_concurrent_list_get_equal_func (self, &_tmp4__target);
		_tmp5_ = _tmp4_;
		_tmp5__target = _tmp4__target;
		_tmp6_ = iter;
		_tmp7_ = gee_iterator_get (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp5_ (item, _tmp8_, _tmp5__target);
		((_tmp8_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp8_ = (self->priv->g_destroy_func (_tmp8_), NULL));
		if (_tmp9_) {
			GeeIterator* _tmp10_;
			_tmp10_ = iter;
			gee_iterator_remove (_tmp10_);
			result = TRUE;
			_g_object_unref0 (iter);
			_gee_hazard_pointer_context_free0 (ctx);
			return result;
		}
	}
	result = FALSE;
	_g_object_unref0 (iter);
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

/**
 * {@inheritDoc}
 */
static void
gee_concurrent_list_real_clear (GeeAbstractCollection* base)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	GeeIterator* iter = NULL;
	GeeIterator* _tmp2_;
	GeeConcurrentListNode* _tmp5_;
	GeeConcurrentListNode* _tmp6_;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_tmp2_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
	iter = _tmp2_;
	while (TRUE) {
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp3_ = iter;
		if (!gee_iterator_next (_tmp3_)) {
			break;
		}
		_tmp4_ = iter;
		gee_iterator_remove (_tmp4_);
	}
	_tmp5_ = self->priv->_head;
	_tmp6_ = _gee_concurrent_list_node_ref0 (_tmp5_);
	gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->priv->_tail, _tmp6_, (gsize) 0, (gsize) 0);
	_g_object_unref0 (iter);
	_gee_hazard_pointer_context_free0 (ctx);
}

/**
 * {@inheritDoc}
 */
static GeeIterator*
gee_concurrent_list_real_iterator (GeeAbstractCollection* base)
{
	GeeConcurrentList * self;
	GeeConcurrentListNode* _tmp0_;
	GeeConcurrentListIterator* _tmp1_;
	GeeIterator* result;
	self = (GeeConcurrentList*) base;
	_tmp0_ = self->priv->_head;
	_tmp1_ = gee_concurrent_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp0_);
	result = (GeeIterator*) _tmp1_;
	return result;
}

/**
 * {@inheritDoc}
 */
static GeeListIterator*
gee_concurrent_list_real_list_iterator (GeeAbstractList* base)
{
	GeeConcurrentList * self;
	GeeConcurrentListNode* _tmp0_;
	GeeConcurrentListIterator* _tmp1_;
	GeeListIterator* result;
	self = (GeeConcurrentList*) base;
	_tmp0_ = self->priv->_head;
	_tmp1_ = gee_concurrent_list_iterator_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp0_);
	result = (GeeListIterator*) _tmp1_;
	return result;
}

/**
 * {@inheritDoc}
 */
static gpointer
gee_concurrent_list_real_get (GeeAbstractList* base,
                              gint index)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	gpointer result;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_vala_assert (index >= 0, "index >= 0");
	{
		GeeIterator* iterator = NULL;
		GeeIterator* _tmp2_;
		_tmp2_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
		iterator = _tmp2_;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GeeIterator* _tmp4_;
				gint _tmp5_;
				if (!_tmp3_) {
				}
				_tmp3_ = FALSE;
				_tmp4_ = iterator;
				if (!gee_iterator_next (_tmp4_)) {
					break;
				}
				_tmp5_ = index;
				index = _tmp5_ - 1;
				if (_tmp5_ == 0) {
					GeeIterator* _tmp6_;
					gpointer _tmp7_;
					_tmp6_ = iterator;
					_tmp7_ = gee_iterator_get (_tmp6_);
					result = _tmp7_;
					_g_object_unref0 (iterator);
					_gee_hazard_pointer_context_free0 (ctx);
					return result;
				}
			}
		}
		_g_object_unref0 (iterator);
	}
	g_assert_not_reached ();
}

/**
 * {@inheritDoc}
 */
static void
gee_concurrent_list_real_set (GeeAbstractList* base,
                              gint index,
                              gconstpointer item)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_vala_assert (index >= 0, "index >= 0");
	{
		GeeListIterator* iterator = NULL;
		GeeListIterator* _tmp2_;
		_tmp2_ = gee_abstract_list_list_iterator ((GeeAbstractList*) self);
		iterator = _tmp2_;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GeeListIterator* _tmp4_;
				gint _tmp5_;
				if (!_tmp3_) {
				}
				_tmp3_ = FALSE;
				_tmp4_ = iterator;
				if (!gee_iterator_next ((GeeIterator*) _tmp4_)) {
					break;
				}
				_tmp5_ = index;
				index = _tmp5_ - 1;
				if (_tmp5_ == 0) {
					GeeListIterator* _tmp6_;
					_tmp6_ = iterator;
					gee_list_iterator_set (_tmp6_, item);
					_g_object_unref0 (iterator);
					_gee_hazard_pointer_context_free0 (ctx);
					return;
				}
			}
		}
		_g_object_unref0 (iterator);
	}
	g_assert_not_reached ();
}

/**
 * {@inheritDoc}
 */
static gint
gee_concurrent_list_real_index_of (GeeAbstractList* base,
                                   gconstpointer item)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	gint index = 0;
	gint result;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	index = 0;
	{
		GeeListIterator* iterator = NULL;
		GeeListIterator* _tmp2_;
		_tmp2_ = gee_abstract_list_list_iterator ((GeeAbstractList*) self);
		iterator = _tmp2_;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GeeListIterator* _tmp5_;
				GeeEqualDataFunc _tmp6_ = NULL;
				gpointer _tmp6__target = NULL;
				GeeEqualDataFunc _tmp7_;
				gpointer _tmp7__target;
				GeeListIterator* _tmp8_;
				gpointer _tmp9_;
				gpointer _tmp10_;
				gboolean _tmp11_;
				if (!_tmp3_) {
					gint _tmp4_;
					_tmp4_ = index;
					index = _tmp4_ + 1;
				}
				_tmp3_ = FALSE;
				_tmp5_ = iterator;
				if (!gee_iterator_next ((GeeIterator*) _tmp5_)) {
					break;
				}
				_tmp6_ = gee_concurrent_list_get_equal_func (self, &_tmp6__target);
				_tmp7_ = _tmp6_;
				_tmp7__target = _tmp6__target;
				_tmp8_ = iterator;
				_tmp9_ = gee_iterator_get ((GeeIterator*) _tmp8_);
				_tmp10_ = _tmp9_;
				_tmp11_ = _tmp7_ (item, _tmp10_, _tmp7__target);
				((_tmp10_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp10_ = (self->priv->g_destroy_func (_tmp10_), NULL));
				if (_tmp11_) {
					result = index;
					_g_object_unref0 (iterator);
					_gee_hazard_pointer_context_free0 (ctx);
					return result;
				}
			}
		}
		_g_object_unref0 (iterator);
	}
	result = -1;
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

/**
 * {@inheritDoc}
 */
static void
gee_concurrent_list_real_insert (GeeAbstractList* base,
                                 gint index,
                                 gconstpointer item)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_vala_assert (index >= 0, "index >= 0");
	if (index == 0) {
		GeeConcurrentListNode* prev = NULL;
		GeeConcurrentListNode* _tmp2_;
		GeeConcurrentListNode* _tmp3_;
		GeeConcurrentListNode* next = NULL;
		GeeConcurrentListNode* _tmp4_;
		GeeConcurrentListNode* _tmp5_;
		GeeConcurrentListNode* new_node = NULL;
		GeeConcurrentListNode* _tmp6_;
		GeeConcurrentListNode* _tmp7_;
		GeeConcurrentListNode* _tmp8_;
		GeeConcurrentListNode* _tmp9_;
		GeeConcurrentListNode* _tmp10_;
		_tmp2_ = self->priv->_head;
		_tmp3_ = _gee_concurrent_list_node_ref0 (_tmp2_);
		prev = _tmp3_;
		_tmp4_ = self->priv->_head;
		_tmp5_ = gee_concurrent_list_node_get_next (_tmp4_);
		next = _tmp5_;
		_tmp6_ = gee_concurrent_list_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, item);
		new_node = _tmp6_;
		_tmp7_ = new_node;
		_tmp8_ = prev;
		_tmp9_ = _gee_concurrent_list_node_ref0 (_tmp8_);
		_tmp10_ = next;
		gee_concurrent_list_node_insert (_tmp7_, _tmp9_, _tmp10_);
		_gee_concurrent_list_node_unref0 (new_node);
		_gee_concurrent_list_node_unref0 (next);
		_gee_concurrent_list_node_unref0 (prev);
	} else {
		{
			GeeListIterator* iterator = NULL;
			GeeListIterator* _tmp11_;
			_tmp11_ = gee_abstract_list_list_iterator ((GeeAbstractList*) self);
			iterator = _tmp11_;
			{
				gboolean _tmp12_ = FALSE;
				_tmp12_ = TRUE;
				while (TRUE) {
					GeeListIterator* _tmp13_;
					gint _tmp14_;
					if (!_tmp12_) {
					}
					_tmp12_ = FALSE;
					_tmp13_ = iterator;
					if (!gee_iterator_next ((GeeIterator*) _tmp13_)) {
						break;
					}
					index = index - 1;
					_tmp14_ = index;
					if (_tmp14_ == 0) {
						GeeListIterator* _tmp15_;
						_tmp15_ = iterator;
						gee_list_iterator_add (_tmp15_, item);
						_g_object_unref0 (iterator);
						_gee_hazard_pointer_context_free0 (ctx);
						return;
					}
				}
			}
			_g_object_unref0 (iterator);
		}
		g_assert_not_reached ();
	}
	_gee_hazard_pointer_context_free0 (ctx);
}

/**
 * {@inheritDoc}
 */
static gpointer
gee_concurrent_list_real_remove_at (GeeAbstractList* base,
                                    gint index)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	gpointer result;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	{
		GeeListIterator* iterator = NULL;
		GeeListIterator* _tmp2_;
		_tmp2_ = gee_abstract_list_list_iterator ((GeeAbstractList*) self);
		iterator = _tmp2_;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GeeListIterator* _tmp4_;
				gint _tmp5_;
				if (!_tmp3_) {
				}
				_tmp3_ = FALSE;
				_tmp4_ = iterator;
				if (!gee_iterator_next ((GeeIterator*) _tmp4_)) {
					break;
				}
				_tmp5_ = index;
				index = _tmp5_ - 1;
				if (_tmp5_ == 0) {
					gpointer data = NULL;
					GeeListIterator* _tmp6_;
					gpointer _tmp7_;
					GeeListIterator* _tmp8_;
					_tmp6_ = iterator;
					_tmp7_ = gee_iterator_get ((GeeIterator*) _tmp6_);
					data = _tmp7_;
					_tmp8_ = iterator;
					gee_iterator_remove ((GeeIterator*) _tmp8_);
					result = data;
					_g_object_unref0 (iterator);
					_gee_hazard_pointer_context_free0 (ctx);
					return result;
				}
			}
		}
		_g_object_unref0 (iterator);
	}
	g_assert_not_reached ();
}

/**
 * {@inheritDoc}
 */
static gpointer
_gee_functions_equal_data_func_closure_ref0 (gpointer self)
{
	return self ? gee_functions_equal_data_func_closure_ref (self) : NULL;
}

static GeeList*
gee_concurrent_list_real_slice (GeeAbstractList* base,
                                gint start,
                                gint end)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	GeeConcurrentList* list = NULL;
	GeeFunctionsEqualDataFuncClosure* _tmp2_;
	GeeFunctionsEqualDataFuncClosure* _tmp3_;
	GeeConcurrentList* _tmp4_;
	GeeIterator* iterator = NULL;
	GeeIterator* _tmp5_;
	gint idx = 0;
	GeeList* result;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_vala_assert (0 <= start, "0 <= start");
	_vala_assert (start <= end, "start <= end");
	_tmp2_ = self->priv->_equal_func;
	_tmp3_ = _gee_functions_equal_data_func_closure_ref0 (_tmp2_);
	_tmp4_ = gee_concurrent_list_new_with_closure (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, _tmp3_);
	list = _tmp4_;
	_tmp5_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
	iterator = _tmp5_;
	idx = 0;
	{
		gboolean _tmp6_ = FALSE;
		_tmp6_ = TRUE;
		while (TRUE) {
			GeeIterator* _tmp8_;
			gboolean _tmp9_ = FALSE;
			if (!_tmp6_) {
				gint _tmp7_;
				_tmp7_ = idx;
				idx = _tmp7_ + 1;
			}
			_tmp6_ = FALSE;
			_tmp8_ = iterator;
			if (!gee_iterator_next (_tmp8_)) {
				break;
			}
			if (idx >= start) {
				_tmp9_ = idx < end;
			} else {
				_tmp9_ = FALSE;
			}
			if (_tmp9_) {
				GeeConcurrentList* _tmp10_;
				GeeIterator* _tmp11_;
				gpointer _tmp12_;
				gpointer _tmp13_;
				_tmp10_ = list;
				_tmp11_ = iterator;
				_tmp12_ = gee_iterator_get (_tmp11_);
				_tmp13_ = _tmp12_;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp10_, _tmp13_);
				((_tmp13_ == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (_tmp13_ = (self->priv->g_destroy_func (_tmp13_), NULL));
			} else {
				if (idx >= end) {
					break;
				}
			}
		}
	}
	_vala_assert (idx >= end, "idx >= end");
	result = (GeeList*) list;
	_g_object_unref0 (iterator);
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

static inline GeeConcurrentListNode*
gee_concurrent_list_update_tail (GeeConcurrentList* self)
{
	GeeConcurrentListNode* tail = NULL;
	gpointer _tmp0_;
	GeeConcurrentListNode* _tmp1_;
	GeeConcurrentListNode* _tmp2_;
	GeeConcurrentListNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->priv->_tail, (gsize) 0, NULL);
	tail = (GeeConcurrentListNode*) _tmp0_;
	gee_concurrent_list_node_backtrace (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &tail);
	gee_concurrent_list_node_search_for (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, NULL, &tail);
	_tmp1_ = tail;
	_tmp2_ = _gee_concurrent_list_node_ref0 (_tmp1_);
	gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->priv->_tail, _tmp2_, (gsize) 0, (gsize) 0);
	result = tail;
	return result;
}

static inline GeeConcurrentListNode*
gee_concurrent_list_get_tail (GeeConcurrentList* self)
{
	GeeConcurrentListNode* _tmp0_;
	GeeConcurrentListNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_concurrent_list_update_tail (self);
	result = _tmp0_;
	return result;
}

GeeEqualDataFunc
gee_concurrent_list_get_equal_func (GeeConcurrentList* self,
                                    gpointer* result_target)
{
	GeeEqualDataFunc result;
	GeeFunctionsEqualDataFuncClosure* _tmp0_;
	GeeEqualDataFunc _tmp1_;
	gpointer _tmp1__target;
	GeeEqualDataFunc _tmp2_;
	gpointer _tmp2__target;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_equal_func;
	_tmp1_ = _tmp0_->func;
	_tmp1__target = _tmp0_->func_target;
	_tmp2_ = _tmp1_;
	_tmp2__target = _tmp1__target;
	*result_target = _tmp2__target;
	result = _tmp2_;
	return result;
}

static void
gee_concurrent_list_set_equal_func (GeeConcurrentList* self,
                                    GeeEqualDataFunc value,
                                    gpointer value_target)
{
	g_return_if_fail (self != NULL);
}

static gboolean
gee_concurrent_list_real_get_read_only (GeeAbstractCollection* base)
{
	gboolean result;
	GeeConcurrentList* self;
	self = (GeeConcurrentList*) base;
	result = FALSE;
	return result;
}

static gint
gee_concurrent_list_real_get_size (GeeAbstractCollection* base)
{
	gint result;
	GeeConcurrentList* self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	gint _result_ = 0;
	self = (GeeConcurrentList*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_result_ = 0;
	{
		GeeIterator* iter = NULL;
		GeeIterator* _tmp2_;
		_tmp2_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
		iter = _tmp2_;
		{
			gboolean _tmp3_ = FALSE;
			_tmp3_ = TRUE;
			while (TRUE) {
				GeeIterator* _tmp4_;
				gint _tmp5_;
				if (!_tmp3_) {
				}
				_tmp3_ = FALSE;
				_tmp4_ = iter;
				if (!gee_iterator_next (_tmp4_)) {
					break;
				}
				_tmp5_ = _result_;
				_result_ = _tmp5_ + 1;
			}
		}
		_g_object_unref0 (iter);
	}
	result = _result_;
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

gboolean
gee_concurrent_list_get_is_empty (GeeConcurrentList* self)
{
	gboolean result;
	GeeIterator* _tmp0_;
	GeeIterator* _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = !gee_iterator_next (_tmp1_);
	_g_object_unref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

static inline gpointer
gee_concurrent_list_iterator_get_instance_private (GeeConcurrentListIterator* self)
{
	return G_STRUCT_MEMBER_P (self, GeeConcurrentListIterator_private_offset);
}

static GeeConcurrentListIterator*
gee_concurrent_list_iterator_construct (GType object_type,
                                        GType g_type,
                                        GBoxedCopyFunc g_dup_func,
                                        GDestroyNotify g_destroy_func,
                                        GeeConcurrentListNode* head)
{
	GeeConcurrentListIterator * self = NULL;
	GeeConcurrentListNode* _tmp0_;
	g_return_val_if_fail (head != NULL, NULL);
	self = (GeeConcurrentListIterator*) g_object_new (object_type, "g-type", g_type, "g-dup-func", g_dup_func, "g-destroy-func", g_destroy_func, NULL);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	self->_removed = FALSE;
	self->_index = -1;
	_gee_concurrent_list_node_unref0 (self->_prev);
	self->_prev = NULL;
	_tmp0_ = _gee_concurrent_list_node_ref0 (head);
	_gee_concurrent_list_node_unref0 (self->_curr);
	self->_curr = _tmp0_;
	return self;
}

static GeeConcurrentListIterator*
gee_concurrent_list_iterator_new (GType g_type,
                                  GBoxedCopyFunc g_dup_func,
                                  GDestroyNotify g_destroy_func,
                                  GeeConcurrentListNode* head)
{
	return gee_concurrent_list_iterator_construct (GEE_CONCURRENT_LIST_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, head);
}

static GeeConcurrentListIterator*
gee_concurrent_list_iterator_construct_from_iterator (GType object_type,
                                                      GType g_type,
                                                      GBoxedCopyFunc g_dup_func,
                                                      GDestroyNotify g_destroy_func,
                                                      GeeConcurrentListIterator* iter)
{
	GeeConcurrentListIterator * self = NULL;
	GeeConcurrentListNode* _tmp0_;
	GeeConcurrentListNode* _tmp1_;
	GeeConcurrentListNode* _tmp2_;
	GeeConcurrentListNode* _tmp3_;
	g_return_val_if_fail (iter != NULL, NULL);
	self = (GeeConcurrentListIterator*) g_object_new (object_type, "g-type", g_type, "g-dup-func", g_dup_func, "g-destroy-func", g_destroy_func, NULL);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	self->_removed = iter->_removed;
	self->_index = iter->_index;
	_tmp0_ = iter->_prev;
	_tmp1_ = _gee_concurrent_list_node_ref0 (_tmp0_);
	_gee_concurrent_list_node_unref0 (self->_prev);
	self->_prev = _tmp1_;
	_tmp2_ = iter->_curr;
	_tmp3_ = _gee_concurrent_list_node_ref0 (_tmp2_);
	_gee_concurrent_list_node_unref0 (self->_curr);
	self->_curr = _tmp3_;
	return self;
}

static GeeConcurrentListIterator*
gee_concurrent_list_iterator_new_from_iterator (GType g_type,
                                                GBoxedCopyFunc g_dup_func,
                                                GDestroyNotify g_destroy_func,
                                                GeeConcurrentListIterator* iter)
{
	return gee_concurrent_list_iterator_construct_from_iterator (GEE_CONCURRENT_LIST_TYPE_ITERATOR, g_type, g_dup_func, g_destroy_func, iter);
}

static gboolean
gee_concurrent_list_iterator_real_next (GeeIterator* base)
{
	GeeConcurrentListIterator * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	GeeConcurrentListNode* _tmp2_ = NULL;
	GeeConcurrentListNode* _old_prev = NULL;
	GeeConcurrentListNode* _tmp4_;
	gboolean success = FALSE;
	gboolean _tmp5_;
	gboolean result;
	self = (GeeConcurrentListIterator*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	if (self->_removed) {
		GeeConcurrentListNode* _tmp3_;
		_tmp3_ = self->_prev;
		_tmp2_ = _tmp3_;
	} else {
		_tmp2_ = NULL;
	}
	_tmp4_ = _gee_concurrent_list_node_ref0 (_tmp2_);
	_old_prev = _tmp4_;
	_tmp5_ = gee_concurrent_list_node_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &self->_prev, &self->_curr, FALSE);
	success = _tmp5_;
	if (success) {
		gint _tmp7_;
		if (self->_removed) {
			GeeConcurrentListNode* _tmp6_;
			_tmp6_ = _old_prev;
			_old_prev = NULL;
			_gee_concurrent_list_node_unref0 (self->_prev);
			self->_prev = _tmp6_;
		}
		self->_removed = FALSE;
		_tmp7_ = self->_index;
		self->_index = _tmp7_ + 1;
	}
	result = success;
	_gee_concurrent_list_node_unref0 (_old_prev);
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

static gboolean
gee_concurrent_list_iterator_real_has_next (GeeIterator* base)
{
	GeeConcurrentListIterator * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeConcurrentListNode* prev = NULL;
	GeeConcurrentListNode* _tmp1_;
	GeeConcurrentListNode* _tmp2_;
	GeeConcurrentListNode* curr = NULL;
	GeeConcurrentListNode* _tmp3_;
	GeeConcurrentListNode* _tmp4_;
	gboolean _tmp5_;
	gboolean result;
	self = (GeeConcurrentListIterator*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	gee_utils_misc_unused (ctx);
	_tmp1_ = self->_prev;
	_tmp2_ = _gee_concurrent_list_node_ref0 (_tmp1_);
	prev = _tmp2_;
	_tmp3_ = self->_curr;
	_tmp4_ = _gee_concurrent_list_node_ref0 (_tmp3_);
	curr = _tmp4_;
	_tmp5_ = gee_concurrent_list_node_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &prev, &curr, FALSE);
	result = _tmp5_;
	_gee_concurrent_list_node_unref0 (curr);
	_gee_concurrent_list_node_unref0 (prev);
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

static gpointer
gee_concurrent_list_iterator_real_get (GeeIterator* base)
{
	GeeConcurrentListIterator * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GeeConcurrentListNode* _tmp3_;
	gpointer _tmp4_;
	gpointer result;
	self = (GeeConcurrentListIterator*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	gee_utils_misc_unused (ctx);
	_tmp1_ = gee_iterator_get_valid ((GeeIterator*) self);
	_tmp2_ = _tmp1_;
	_vala_assert (_tmp2_, "valid");
	_tmp3_ = self->_curr;
	_tmp4_ = gee_hazard_pointer_get_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &_tmp3_->_data, (gsize) 0, NULL);
	result = _tmp4_;
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

static void
gee_concurrent_list_iterator_real_set (GeeListIterator* base,
                                       gconstpointer item)
{
	GeeConcurrentListIterator * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GeeConcurrentListNode* _tmp3_;
	gpointer _tmp4_;
	self = (GeeConcurrentListIterator*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	gee_utils_misc_unused (ctx);
	_tmp1_ = gee_iterator_get_valid ((GeeIterator*) self);
	_tmp2_ = _tmp1_;
	_vala_assert (_tmp2_, "valid");
	_tmp3_ = self->_curr;
	_tmp4_ = ((item != NULL) && (self->priv->g_dup_func != NULL)) ? self->priv->g_dup_func ((gpointer) item) : ((gpointer) item);
	gee_hazard_pointer_set_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &_tmp3_->_data, _tmp4_, (gsize) 0, (gsize) 0);
	_gee_hazard_pointer_context_free0 (ctx);
}

static void
gee_concurrent_list_iterator_real_remove (GeeIterator* base)
{
	GeeConcurrentListIterator * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	GeeConcurrentListNode* _tmp3_;
	GeeConcurrentListNode* _tmp4_;
	gint _tmp5_;
	self = (GeeConcurrentListIterator*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	gee_utils_misc_unused (ctx);
	_tmp1_ = gee_iterator_get_valid ((GeeIterator*) self);
	_tmp2_ = _tmp1_;
	_vala_assert (_tmp2_, "valid");
	_tmp3_ = self->_curr;
	_tmp4_ = self->_prev;
	gee_concurrent_list_node_remove (_tmp3_, _tmp4_);
	self->_removed = TRUE;
	_tmp5_ = self->_index;
	self->_index = _tmp5_ - 1;
	_gee_hazard_pointer_context_free0 (ctx);
}

static gint
gee_concurrent_list_iterator_real_index (GeeListIterator* base)
{
	GeeConcurrentListIterator * self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	gint result;
	self = (GeeConcurrentListIterator*) base;
	_tmp0_ = gee_iterator_get_valid ((GeeIterator*) self);
	_tmp1_ = _tmp0_;
	_vala_assert (_tmp1_, "valid");
	result = self->_index;
	return result;
}

static void
gee_concurrent_list_iterator_real_add (GeeListIterator* base,
                                       gconstpointer item)
{
	GeeConcurrentListIterator * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	GeeConcurrentListNode* new_node = NULL;
	GeeConcurrentListNode* _tmp6_;
	GeeConcurrentListNode* _tmp7_;
	GeeConcurrentListNode* _tmp8_;
	GeeConcurrentListNode* _tmp9_;
	GeeConcurrentListNode* _tmp10_;
	GeeConcurrentListNode* _tmp11_;
	gint _tmp12_;
	self = (GeeConcurrentListIterator*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_tmp2_ = gee_iterator_get_valid ((GeeIterator*) self);
	_tmp3_ = _tmp2_;
	_vala_assert (_tmp3_, "valid");
	_tmp4_ = gee_concurrent_list_node_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &self->_prev, &self->_curr, FALSE);
	if (!_tmp4_) {
		GeeConcurrentListNode* _tmp5_;
		_tmp5_ = self->_curr;
		self->_curr = NULL;
		_gee_concurrent_list_node_unref0 (self->_prev);
		self->_prev = _tmp5_;
		_gee_concurrent_list_node_unref0 (self->_curr);
		self->_curr = NULL;
	}
	_tmp6_ = gee_concurrent_list_node_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, item);
	new_node = _tmp6_;
	_tmp7_ = new_node;
	_tmp8_ = self->_prev;
	_tmp9_ = _gee_concurrent_list_node_ref0 (_tmp8_);
	_tmp10_ = self->_curr;
	gee_concurrent_list_node_insert (_tmp7_, _tmp9_, _tmp10_);
	_tmp11_ = new_node;
	new_node = NULL;
	_gee_concurrent_list_node_unref0 (self->_curr);
	self->_curr = _tmp11_;
	_tmp12_ = self->_index;
	self->_index = _tmp12_ + 1;
	self->_removed = FALSE;
	_gee_concurrent_list_node_unref0 (new_node);
	_gee_hazard_pointer_context_free0 (ctx);
}

static gboolean
gee_concurrent_list_iterator_real_foreach (GeeTraversable* base,
                                           GeeForallFunc f,
                                           gpointer f_target)
{
	GeeConcurrentListIterator * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	gboolean _tmp2_ = FALSE;
	GeeConcurrentListNode* _tmp3_;
	GeeConcurrentListNode* _tmp6_ = NULL;
	GeeConcurrentListNode* _old_prev = NULL;
	GeeConcurrentListNode* _tmp8_;
	gboolean result;
	self = (GeeConcurrentListIterator*) base;
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_tmp3_ = self->_prev;
	if (_tmp3_ != NULL) {
		_tmp2_ = !self->_removed;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		GeeConcurrentListNode* _tmp4_;
		gpointer _tmp5_;
		_tmp4_ = self->_curr;
		_tmp5_ = gee_hazard_pointer_get_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &_tmp4_->_data, (gsize) 0, NULL);
		if (!f (_tmp5_, f_target)) {
			result = FALSE;
			_gee_hazard_pointer_context_free0 (ctx);
			return result;
		}
	}
	if (self->_removed) {
		GeeConcurrentListNode* _tmp7_;
		_tmp7_ = self->_prev;
		_tmp6_ = _tmp7_;
	} else {
		_tmp6_ = NULL;
	}
	_tmp8_ = _gee_concurrent_list_node_ref0 (_tmp6_);
	_old_prev = _tmp8_;
	while (TRUE) {
		gboolean _tmp9_;
		gint _tmp11_;
		GeeConcurrentListNode* _tmp12_;
		gpointer _tmp13_;
		_tmp9_ = gee_concurrent_list_node_proceed (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &self->_prev, &self->_curr, FALSE);
		if (!_tmp9_) {
			break;
		}
		if (self->_removed) {
			GeeConcurrentListNode* _tmp10_;
			_tmp10_ = _old_prev;
			_old_prev = NULL;
			_gee_concurrent_list_node_unref0 (self->_prev);
			self->_prev = _tmp10_;
		}
		self->_removed = FALSE;
		_tmp11_ = self->_index;
		self->_index = _tmp11_ + 1;
		_tmp12_ = self->_curr;
		_tmp13_ = gee_hazard_pointer_get_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &_tmp12_->_data, (gsize) 0, NULL);
		if (!f (_tmp13_, f_target)) {
			result = FALSE;
			_gee_concurrent_list_node_unref0 (_old_prev);
			_gee_hazard_pointer_context_free0 (ctx);
			return result;
		}
	}
	result = TRUE;
	_gee_concurrent_list_node_unref0 (_old_prev);
	_gee_hazard_pointer_context_free0 (ctx);
	return result;
}

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

static GeeIterator**
gee_concurrent_list_iterator_real_tee (GeeTraversable* base,
                                       guint forks,
                                       gint* result_length1)
{
	GeeConcurrentListIterator * self;
	GeeIterator** result;
	self = (GeeConcurrentListIterator*) base;
	if (forks == ((guint) 0)) {
		GeeIterator** _tmp0_;
		GeeIterator** _tmp1_;
		gint _tmp1__length1;
		_tmp0_ = g_new0 (GeeIterator*, 0 + 1);
		_tmp1_ = _tmp0_;
		_tmp1__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp1__length1;
		}
		result = _tmp1_;
		return result;
	} else {
		GeeIterator** _result_ = NULL;
		GeeIterator** _tmp2_;
		gint _result__length1;
		gint __result__size_;
		GeeIterator** _tmp3_;
		gint _tmp3__length1;
		GeeIterator* _tmp4_;
		GeeIterator** _tmp9_;
		gint _tmp9__length1;
		_tmp2_ = g_new0 (GeeIterator*, forks + 1);
		_result_ = _tmp2_;
		_result__length1 = forks;
		__result__size_ = _result__length1;
		_tmp3_ = _result_;
		_tmp3__length1 = _result__length1;
		_tmp4_ = _g_object_ref0 ((GeeIterator*) self);
		_g_object_unref0 (_tmp3_[0]);
		_tmp3_[0] = _tmp4_;
		{
			guint i = 0U;
			i = (guint) 1;
			{
				gboolean _tmp5_ = FALSE;
				_tmp5_ = TRUE;
				while (TRUE) {
					GeeIterator** _tmp7_;
					gint _tmp7__length1;
					GeeConcurrentListIterator* _tmp8_;
					if (!_tmp5_) {
						guint _tmp6_;
						_tmp6_ = i;
						i = _tmp6_ + 1;
					}
					_tmp5_ = FALSE;
					if (!(i < forks)) {
						break;
					}
					_tmp7_ = _result_;
					_tmp7__length1 = _result__length1;
					_tmp8_ = gee_concurrent_list_iterator_new_from_iterator (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self);
					_g_object_unref0 (_tmp7_[i]);
					_tmp7_[i] = (GeeIterator*) _tmp8_;
				}
			}
		}
		_tmp9_ = _result_;
		_tmp9__length1 = _result__length1;
		if (result_length1) {
			*result_length1 = _tmp9__length1;
		}
		result = _tmp9_;
		return result;
	}
}

static gboolean
gee_concurrent_list_iterator_real_get_valid (GeeIterator* base)
{
	gboolean result;
	GeeConcurrentListIterator* self;
	GeeConcurrentListNode* _tmp0_;
	gboolean _tmp1_ = FALSE;
	GeeConcurrentListNode* _tmp2_;
	self = (GeeConcurrentListIterator*) base;
	_tmp0_ = self->_curr;
	_vala_assert (_tmp0_ != NULL, "_curr != null");
	_tmp2_ = self->_prev;
	if (_tmp2_ != NULL) {
		_tmp1_ = !self->_removed;
	} else {
		_tmp1_ = FALSE;
	}
	result = _tmp1_;
	return result;
}

static gboolean
gee_concurrent_list_iterator_real_get_read_only (GeeIterator* base)
{
	gboolean result;
	GeeConcurrentListIterator* self;
	self = (GeeConcurrentListIterator*) base;
	result = FALSE;
	return result;
}

static void
gee_concurrent_list_iterator_class_init (GeeConcurrentListIteratorClass * klass,
                                         gpointer klass_data)
{
	gee_concurrent_list_iterator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GeeConcurrentListIterator_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_concurrent_list_iterator_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_concurrent_list_iterator_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_concurrent_list_iterator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_ITERATOR_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), GEE_CONCURRENT_LIST_ITERATOR_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), GEE_CONCURRENT_LIST_ITERATOR_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), GEE_CONCURRENT_LIST_ITERATOR_VALID_PROPERTY, gee_concurrent_list_iterator_properties[GEE_CONCURRENT_LIST_ITERATOR_VALID_PROPERTY] = g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_ITERATOR_READ_ONLY_PROPERTY, gee_concurrent_list_iterator_properties[GEE_CONCURRENT_LIST_ITERATOR_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static GType
gee_concurrent_list_iterator_gee_traversable_get_g_type (GeeConcurrentListIterator* self)
{
	return (GType) self->priv->g_type;
}

static GBoxedCopyFunc
gee_concurrent_list_iterator_gee_traversable_get_g_dup_func (GeeConcurrentListIterator* self)
{
	return (GBoxedCopyFunc) self->priv->g_dup_func;
}

static GDestroyNotify
gee_concurrent_list_iterator_gee_traversable_get_g_destroy_func (GeeConcurrentListIterator* self)
{
	return (GDestroyNotify) self->priv->g_destroy_func;
}

static void
gee_concurrent_list_iterator_gee_traversable_interface_init (GeeTraversableIface * iface,
                                                             gpointer iface_data)
{
	gee_concurrent_list_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
	iface->foreach = (gboolean (*) (GeeTraversable*, GeeForallFunc, gpointer)) gee_concurrent_list_iterator_real_foreach;
	iface->tee = (GeeIterator** (*) (GeeTraversable*, guint, gint*)) gee_concurrent_list_iterator_real_tee;
	iface->get_g_type = (GType (*) (GeeTraversable *)) gee_concurrent_list_iterator_gee_traversable_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeTraversable *)) gee_concurrent_list_iterator_gee_traversable_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify (*) (GeeTraversable *)) gee_concurrent_list_iterator_gee_traversable_get_g_destroy_func;
}

static void
gee_concurrent_list_iterator_gee_iterator_interface_init (GeeIteratorIface * iface,
                                                          gpointer iface_data)
{
	gee_concurrent_list_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->next = (gboolean (*) (GeeIterator*)) gee_concurrent_list_iterator_real_next;
	iface->has_next = (gboolean (*) (GeeIterator*)) gee_concurrent_list_iterator_real_has_next;
	iface->get = (gpointer (*) (GeeIterator*)) gee_concurrent_list_iterator_real_get;
	iface->remove = (void (*) (GeeIterator*)) gee_concurrent_list_iterator_real_remove;
	iface->get_valid = gee_concurrent_list_iterator_real_get_valid;
	iface->get_read_only = gee_concurrent_list_iterator_real_get_read_only;
}

static void
gee_concurrent_list_iterator_gee_list_iterator_interface_init (GeeListIteratorIface * iface,
                                                               gpointer iface_data)
{
	gee_concurrent_list_iterator_gee_list_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->set = (void (*) (GeeListIterator*, gconstpointer)) gee_concurrent_list_iterator_real_set;
	iface->index = (gint (*) (GeeListIterator*)) gee_concurrent_list_iterator_real_index;
	iface->add = (void (*) (GeeListIterator*, gconstpointer)) gee_concurrent_list_iterator_real_add;
}

static void
gee_concurrent_list_iterator_instance_init (GeeConcurrentListIterator * self,
                                            gpointer klass)
{
	self->priv = gee_concurrent_list_iterator_get_instance_private (self);
}

static void
gee_concurrent_list_iterator_finalize (GObject * obj)
{
	GeeConcurrentListIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIterator);
	_gee_concurrent_list_node_unref0 (self->_prev);
	_gee_concurrent_list_node_unref0 (self->_curr);
	G_OBJECT_CLASS (gee_concurrent_list_iterator_parent_class)->finalize (obj);
}

static GType
gee_concurrent_list_iterator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentListIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_list_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentListIterator), 0, (GInstanceInitFunc) gee_concurrent_list_iterator_instance_init, NULL };
	static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gee_concurrent_list_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gee_concurrent_list_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gee_list_iterator_info = { (GInterfaceInitFunc) gee_concurrent_list_iterator_gee_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gee_concurrent_list_iterator_type_id;
	gee_concurrent_list_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeConcurrentListIterator", &g_define_type_info, 0);
	g_type_add_interface_static (gee_concurrent_list_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
	g_type_add_interface_static (gee_concurrent_list_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
	g_type_add_interface_static (gee_concurrent_list_iterator_type_id, GEE_TYPE_LIST_ITERATOR, &gee_list_iterator_info);
	GeeConcurrentListIterator_private_offset = g_type_add_instance_private (gee_concurrent_list_iterator_type_id, sizeof (GeeConcurrentListIteratorPrivate));
	return gee_concurrent_list_iterator_type_id;
}

static GType
gee_concurrent_list_iterator_get_type (void)
{
	static volatile gsize gee_concurrent_list_iterator_type_id__once = 0;
	if (g_once_init_enter (&gee_concurrent_list_iterator_type_id__once)) {
		GType gee_concurrent_list_iterator_type_id;
		gee_concurrent_list_iterator_type_id = gee_concurrent_list_iterator_get_type_once ();
		g_once_init_leave (&gee_concurrent_list_iterator_type_id__once, gee_concurrent_list_iterator_type_id);
	}
	return gee_concurrent_list_iterator_type_id__once;
}

static void
_vala_gee_concurrent_list_iterator_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	GeeConcurrentListIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIterator);
	switch (property_id) {
		case GEE_CONCURRENT_LIST_ITERATOR_VALID_PROPERTY:
		g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
		break;
		case GEE_CONCURRENT_LIST_ITERATOR_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
		break;
		case GEE_CONCURRENT_LIST_ITERATOR_G_TYPE:
		g_value_set_gtype (value, self->priv->g_type);
		break;
		case GEE_CONCURRENT_LIST_ITERATOR_G_DUP_FUNC:
		g_value_set_pointer (value, self->priv->g_dup_func);
		break;
		case GEE_CONCURRENT_LIST_ITERATOR_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_gee_concurrent_list_iterator_set_property (GObject * object,
                                                 guint property_id,
                                                 const GValue * value,
                                                 GParamSpec * pspec)
{
	GeeConcurrentListIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_CONCURRENT_LIST_TYPE_ITERATOR, GeeConcurrentListIterator);
	switch (property_id) {
		case GEE_CONCURRENT_LIST_ITERATOR_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_CONCURRENT_LIST_ITERATOR_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_CONCURRENT_LIST_ITERATOR_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;
	}
}

static inline gpointer
gee_concurrent_list_node_get_instance_private (GeeConcurrentListNode* self)
{
	return G_STRUCT_MEMBER_P (self, GeeConcurrentListNode_private_offset);
}

static GeeConcurrentListNode*
gee_concurrent_list_node_construct (GType object_type,
                                    GType g_type,
                                    GBoxedCopyFunc g_dup_func,
                                    GDestroyNotify g_destroy_func,
                                    gconstpointer data)
{
	GeeConcurrentListNode* self = NULL;
	gpointer data_copy = NULL;
	gpointer _tmp0_;
	gconstpointer* data_ptr = NULL;
	gpointer _tmp1_;
	gconstpointer* _tmp2_;
	self = (GeeConcurrentListNode*) g_type_create_instance (object_type);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	g_atomic_pointer_set ((volatile gpointer *) (&self->_succ), NULL);
	g_atomic_pointer_set ((volatile gpointer *) (&self->_backlink), NULL);
	_tmp0_ = ((data != NULL) && (g_dup_func != NULL)) ? g_dup_func ((gpointer) data) : ((gpointer) data);
	data_copy = _tmp0_;
	_tmp1_ = data_copy;
	data_copy = NULL;
	data_ptr = _tmp1_;
	_tmp2_ = data_ptr;
	data_ptr = NULL;
	g_atomic_pointer_set ((volatile gpointer *) (&self->_data), _tmp2_);
	((data_copy == NULL) || (g_destroy_func == NULL)) ? NULL : (data_copy = (g_destroy_func (data_copy), NULL));
	return self;
}

static GeeConcurrentListNode*
gee_concurrent_list_node_new (GType g_type,
                              GBoxedCopyFunc g_dup_func,
                              GDestroyNotify g_destroy_func,
                              gconstpointer data)
{
	return gee_concurrent_list_node_construct (GEE_CONCURRENT_LIST_TYPE_NODE, g_type, g_dup_func, g_destroy_func, data);
}

static GeeConcurrentListNode*
gee_concurrent_list_node_construct_head (GType object_type,
                                         GType g_type,
                                         GBoxedCopyFunc g_dup_func,
                                         GDestroyNotify g_destroy_func)
{
	GeeConcurrentListNode* self = NULL;
	self = (GeeConcurrentListNode*) g_type_create_instance (object_type);
	self->priv->g_type = g_type;
	self->priv->g_dup_func = g_dup_func;
	self->priv->g_destroy_func = g_destroy_func;
	g_atomic_pointer_set ((volatile gpointer *) (&self->_succ), NULL);
	g_atomic_pointer_set ((volatile gpointer *) (&self->_backlink), NULL);
	g_atomic_pointer_set ((volatile gpointer *) (&self->_data), NULL);
	return self;
}

static GeeConcurrentListNode*
gee_concurrent_list_node_new_head (GType g_type,
                                   GBoxedCopyFunc g_dup_func,
                                   GDestroyNotify g_destroy_func)
{
	return gee_concurrent_list_node_construct_head (GEE_CONCURRENT_LIST_TYPE_NODE, g_type, g_dup_func, g_destroy_func);
}

static inline gboolean
gee_concurrent_list_node_proceed (GType g_type,
                                  GBoxedCopyFunc g_dup_func,
                                  GDestroyNotify g_destroy_func,
                                  GeeConcurrentListNode** prev,
                                  GeeConcurrentListNode** curr,
                                  gboolean force)
{
	GeeConcurrentListNode* next = NULL;
	GeeConcurrentListNode* _tmp0_;
	gboolean success = FALSE;
	GeeConcurrentListNode* _tmp14_;
	gboolean _tmp15_ = FALSE;
	gboolean result;
	g_return_val_if_fail (*curr != NULL, FALSE);
	_tmp0_ = gee_concurrent_list_node_get_next (*curr);
	next = _tmp0_;
	while (TRUE) {
		GeeConcurrentListNode* _tmp1_;
		GeeConcurrentListState next_state = 0;
		GeeConcurrentListNode* _tmp2_;
		GeeConcurrentListState curr_state = 0;
		GeeConcurrentListNode* curr_next = NULL;
		GeeConcurrentListState _tmp3_ = 0;
		GeeConcurrentListNode* _tmp4_;
		gboolean _tmp5_ = FALSE;
		GeeConcurrentListNode* _tmp9_;
		GeeConcurrentListNode* _tmp10_;
		GeeConcurrentListNode* _tmp12_;
		GeeConcurrentListNode* _tmp13_;
		_tmp1_ = next;
		if (!(_tmp1_ != NULL)) {
			break;
		}
		_tmp2_ = next;
		next_state = gee_concurrent_list_node_get_state (_tmp2_);
		_tmp4_ = gee_concurrent_list_node_get_succ (*curr, &_tmp3_);
		curr_state = _tmp3_;
		curr_next = _tmp4_;
		if (next_state != GEE_CONCURRENT_LIST_STATE_MARKED) {
			_tmp5_ = TRUE;
		} else {
			gboolean _tmp6_ = FALSE;
			if (curr_state == GEE_CONCURRENT_LIST_STATE_MARKED) {
				GeeConcurrentListNode* _tmp7_;
				GeeConcurrentListNode* _tmp8_;
				_tmp7_ = curr_next;
				_tmp8_ = next;
				_tmp6_ = _tmp7_ == _tmp8_;
			} else {
				_tmp6_ = FALSE;
			}
			_tmp5_ = _tmp6_;
		}
		if (_tmp5_) {
			_gee_concurrent_list_node_unref0 (curr_next);
			break;
		}
		_tmp9_ = curr_next;
		_tmp10_ = next;
		if (_tmp9_ == _tmp10_) {
			GeeConcurrentListNode* _tmp11_;
			_tmp11_ = next;
			gee_concurrent_list_node_help_marked (_tmp11_, *curr);
		}
		_tmp12_ = curr_next;
		_tmp13_ = _gee_concurrent_list_node_ref0 (_tmp12_);
		_gee_concurrent_list_node_unref0 (next);
		next = _tmp13_;
		_gee_concurrent_list_node_unref0 (curr_next);
	}
	_tmp14_ = next;
	success = _tmp14_ != NULL;
	if (success) {
		_tmp15_ = TRUE;
	} else {
		_tmp15_ = force;
	}
	if (_tmp15_) {
		GeeConcurrentListNode* _tmp16_;
		GeeConcurrentListNode* _tmp17_;
		_tmp16_ = *curr;
		*curr = NULL;
		_gee_concurrent_list_node_unref0 (*prev);
		*prev = _tmp16_;
		_tmp17_ = next;
		next = NULL;
		_gee_concurrent_list_node_unref0 (*curr);
		*curr = _tmp17_;
	}
	result = success;
	_gee_concurrent_list_node_unref0 (next);
	return result;
}

static inline gboolean
gee_concurrent_list_node_search_for (GType g_type,
                                     GBoxedCopyFunc g_dup_func,
                                     GDestroyNotify g_destroy_func,
                                     GeeConcurrentListNode* goal,
                                     GeeConcurrentListNode** prev)
{
	GeeConcurrentListNode* curr = NULL;
	GeeConcurrentListNode* _tmp0_;
	GeeConcurrentListNode* _tmp6_;
	gboolean result;
	_tmp0_ = gee_concurrent_list_node_get_next (*prev);
	curr = _tmp0_;
	while (TRUE) {
		gboolean _tmp1_ = FALSE;
		gboolean _tmp2_ = FALSE;
		GeeConcurrentListNode* _tmp3_;
		_tmp3_ = curr;
		if (_tmp3_ != goal) {
			_tmp2_ = TRUE;
		} else {
			GeeConcurrentListNode* _tmp4_;
			_tmp4_ = curr;
			_tmp2_ = _tmp4_ != NULL;
		}
		if (_tmp2_) {
			gboolean _tmp5_;
			_tmp5_ = gee_concurrent_list_node_proceed (g_type, (GBoxedCopyFunc) g_dup_func, (GDestroyNotify) g_destroy_func, prev, &curr, TRUE);
			_tmp1_ = _tmp5_;
		} else {
			_tmp1_ = FALSE;
		}
		if (!_tmp1_) {
			break;
		}
	}
	_tmp6_ = curr;
	result = _tmp6_ == goal;
	_gee_concurrent_list_node_unref0 (curr);
	return result;
}

static inline gboolean
gee_concurrent_list_node_remove (GeeConcurrentListNode* self,
                                 GeeConcurrentListNode* prev_node)
{
	GeeConcurrentListNode* prev = NULL;
	GeeConcurrentListNode* _tmp0_;
	gboolean _result_ = FALSE;
	gboolean _tmp1_;
	GeeConcurrentListNode* _tmp2_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (prev_node != NULL, FALSE);
	_tmp0_ = _gee_concurrent_list_node_ref0 (prev_node);
	prev = _tmp0_;
	_tmp1_ = gee_concurrent_list_node_try_flag (self, &prev);
	_result_ = _tmp1_;
	_tmp2_ = prev;
	if (_tmp2_ != NULL) {
		GeeConcurrentListNode* _tmp3_;
		_tmp3_ = prev;
		gee_concurrent_list_node_help_flagged (self, _tmp3_);
	}
	result = _result_;
	_gee_concurrent_list_node_unref0 (prev);
	return result;
}

static inline void
gee_concurrent_list_node_insert (GeeConcurrentListNode* self,
                                 GeeConcurrentListNode* prev,
                                 GeeConcurrentListNode* next)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (prev != NULL);
	while (TRUE) {
		GeeConcurrentListState prev_state = 0;
		GeeConcurrentListNode* prev_next = NULL;
		GeeConcurrentListState _tmp0_ = 0;
		GeeConcurrentListNode* _tmp1_;
		_tmp1_ = gee_concurrent_list_node_get_succ (self, &_tmp0_);
		prev_state = _tmp0_;
		prev_next = _tmp1_;
		if (prev_state == GEE_CONCURRENT_LIST_STATE_FLAGGED) {
			GeeConcurrentListNode* _tmp2_;
			_tmp2_ = prev_next;
			gee_concurrent_list_node_help_flagged (_tmp2_, prev);
		} else {
			gboolean _result_ = FALSE;
			GeeConcurrentListState _tmp3_ = 0;
			GeeConcurrentListNode* _tmp4_;
			gee_concurrent_list_node_set_succ (self, next, GEE_CONCURRENT_LIST_STATE_NONE);
			_result_ = gee_concurrent_list_node_compare_and_exchange (prev, next, GEE_CONCURRENT_LIST_STATE_NONE, self, GEE_CONCURRENT_LIST_STATE_NONE);
			if (_result_) {
				_gee_concurrent_list_node_unref0 (prev_next);
				_gee_concurrent_list_node_unref0 (prev);
				return;
			}
			_tmp4_ = gee_concurrent_list_node_get_succ (self, &_tmp3_);
			prev_state = _tmp3_;
			_gee_concurrent_list_node_unref0 (prev_next);
			prev_next = _tmp4_;
			if (prev_state == GEE_CONCURRENT_LIST_STATE_FLAGGED) {
				GeeConcurrentListNode* _tmp5_;
				_tmp5_ = prev_next;
				gee_concurrent_list_node_help_flagged (_tmp5_, prev);
			}
			gee_concurrent_list_node_backtrace (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &prev);
		}
		gee_concurrent_list_node_search_for (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, next, &prev);
		_gee_concurrent_list_node_unref0 (prev_next);
	}
}

static inline void
gee_concurrent_list_node_help_flagged (GeeConcurrentListNode* self,
                                       GeeConcurrentListNode* prev)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (prev != NULL);
	gee_concurrent_list_node_set_backlink (self, prev);
	if (gee_concurrent_list_node_get_state (self) != GEE_CONCURRENT_LIST_STATE_MARKED) {
		gee_concurrent_list_node_try_mark (self);
	}
	gee_concurrent_list_node_help_marked (self, prev);
}

static inline void
gee_concurrent_list_node_try_mark (GeeConcurrentListNode* self)
{
	g_return_if_fail (self != NULL);
	{
		gboolean _tmp0_ = FALSE;
		_tmp0_ = TRUE;
		while (TRUE) {
			GeeConcurrentListNode* next_node = NULL;
			GeeConcurrentListNode* _tmp1_;
			gboolean _result_ = FALSE;
			GeeConcurrentListNode* _tmp2_;
			GeeConcurrentListNode* _tmp3_;
			if (!_tmp0_) {
				if (!(gee_concurrent_list_node_get_state (self) != GEE_CONCURRENT_LIST_STATE_MARKED)) {
					break;
				}
			}
			_tmp0_ = FALSE;
			_tmp1_ = gee_concurrent_list_node_get_next (self);
			next_node = _tmp1_;
			_tmp2_ = next_node;
			_tmp3_ = next_node;
			_result_ = gee_concurrent_list_node_compare_and_exchange (self, _tmp2_, GEE_CONCURRENT_LIST_STATE_NONE, _tmp3_, GEE_CONCURRENT_LIST_STATE_MARKED);
			if (!_result_) {
				GeeConcurrentListState state = 0;
				GeeConcurrentListState _tmp4_ = 0;
				GeeConcurrentListNode* _tmp5_;
				_tmp5_ = gee_concurrent_list_node_get_succ (self, &_tmp4_);
				state = _tmp4_;
				_gee_concurrent_list_node_unref0 (next_node);
				next_node = _tmp5_;
				if (state == GEE_CONCURRENT_LIST_STATE_FLAGGED) {
					GeeConcurrentListNode* _tmp6_;
					_tmp6_ = next_node;
					gee_concurrent_list_node_help_flagged (self, _tmp6_);
				}
			}
			_gee_concurrent_list_node_unref0 (next_node);
		}
	}
}

static inline void
gee_concurrent_list_node_help_marked (GeeConcurrentListNode* self,
                                      GeeConcurrentListNode* prev_node)
{
	GeeConcurrentListNode* _tmp0_;
	GeeConcurrentListNode* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (prev_node != NULL);
	_tmp0_ = gee_concurrent_list_node_get_next (self);
	_tmp1_ = _tmp0_;
	gee_concurrent_list_node_compare_and_exchange (prev_node, self, GEE_CONCURRENT_LIST_STATE_FLAGGED, _tmp1_, GEE_CONCURRENT_LIST_STATE_NONE);
	_gee_concurrent_list_node_unref0 (_tmp1_);
}

static inline gboolean
gee_concurrent_list_node_try_flag (GeeConcurrentListNode* self,
                                   GeeConcurrentListNode** prev_node)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	while (TRUE) {
		gboolean _result_ = FALSE;
		GeeConcurrentListState result_state = 0;
		GeeConcurrentListNode* result_node = NULL;
		GeeConcurrentListState _tmp0_ = 0;
		GeeConcurrentListNode* _tmp1_;
		gboolean _tmp2_ = FALSE;
		GeeConcurrentListNode* _tmp3_;
		gboolean _tmp4_;
		if (gee_concurrent_list_node_compare_succ (*prev_node, self, GEE_CONCURRENT_LIST_STATE_FLAGGED)) {
			result = FALSE;
			return result;
		}
		_result_ = gee_concurrent_list_node_compare_and_exchange (*prev_node, self, GEE_CONCURRENT_LIST_STATE_NONE, self, GEE_CONCURRENT_LIST_STATE_FLAGGED);
		if (_result_) {
			result = TRUE;
			return result;
		}
		_tmp1_ = gee_concurrent_list_node_get_succ (*prev_node, &_tmp0_);
		result_state = _tmp0_;
		result_node = _tmp1_;
		_tmp3_ = result_node;
		if (_tmp3_ == self) {
			_tmp2_ = result_state == GEE_CONCURRENT_LIST_STATE_FLAGGED;
		} else {
			_tmp2_ = FALSE;
		}
		if (_tmp2_) {
			result = FALSE;
			_gee_concurrent_list_node_unref0 (result_node);
			return result;
		}
		gee_concurrent_list_node_backtrace (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, prev_node);
		_tmp4_ = gee_concurrent_list_node_search_for (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, self, prev_node);
		if (!_tmp4_) {
			_gee_concurrent_list_node_unref0 (*prev_node);
			*prev_node = NULL;
			result = FALSE;
			_gee_concurrent_list_node_unref0 (result_node);
			return result;
		}
		_gee_concurrent_list_node_unref0 (result_node);
	}
}

static inline void
gee_concurrent_list_node_backtrace (GType g_type,
                                    GBoxedCopyFunc g_dup_func,
                                    GDestroyNotify g_destroy_func,
                                    GeeConcurrentListNode** curr)
{
	while (TRUE) {
		GeeConcurrentListNode* _tmp0_;
		if (!(gee_concurrent_list_node_get_state (*curr) == GEE_CONCURRENT_LIST_STATE_MARKED)) {
			break;
		}
		_tmp0_ = gee_concurrent_list_node_get_backlink (*curr);
		_gee_concurrent_list_node_unref0 (*curr);
		*curr = _tmp0_;
	}
}

static inline gboolean
gee_concurrent_list_node_compare_and_exchange (GeeConcurrentListNode* self,
                                               GeeConcurrentListNode* old_node,
                                               GeeConcurrentListState old_state,
                                               GeeConcurrentListNode* new_node,
                                               GeeConcurrentListState new_state)
{
	GeeConcurrentListNode* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = _gee_concurrent_list_node_ref0 (new_node);
	result = gee_hazard_pointer_compare_and_exchange_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->_succ, old_node, _tmp0_, (gsize) 3, (gsize) old_state, (gsize) new_state);
	return result;
}

static inline gboolean
gee_concurrent_list_node_compare_succ (GeeConcurrentListNode* self,
                                       GeeConcurrentListNode* next,
                                       GeeConcurrentListState state)
{
	gsize cur = 0UL;
	void* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = g_atomic_pointer_get ((volatile gpointer *) (&self->_succ));
	cur = (gsize) _tmp0_;
	result = cur == (((gsize) next) | ((gsize) state));
	return result;
}

static inline GeeConcurrentListNode*
gee_concurrent_list_node_get_next (GeeConcurrentListNode* self)
{
	GeeConcurrentListNode* _tmp0_;
	GeeConcurrentListNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_concurrent_list_node_get_succ (self, NULL);
	result = _tmp0_;
	return result;
}

static inline GeeConcurrentListState
gee_concurrent_list_node_get_state (GeeConcurrentListNode* self)
{
	void* _tmp0_;
	GeeConcurrentListState result;
	g_return_val_if_fail (self != NULL, 0);
	_tmp0_ = g_atomic_pointer_get ((volatile gpointer *) (&self->_succ));
	result = (GeeConcurrentListState) (((gsize) _tmp0_) & 3);
	return result;
}

static inline GeeConcurrentListNode*
gee_concurrent_list_node_get_succ (GeeConcurrentListNode* self,
                                   GeeConcurrentListState* state)
{
	GeeConcurrentListState _vala_state = 0;
	gsize rstate = 0UL;
	GeeConcurrentListNode* succ = NULL;
	gsize _tmp0_ = 0UL;
	gpointer _tmp1_;
	GeeConcurrentListNode* _tmp2_;
	GeeConcurrentListNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->_succ, (gsize) 3, &_tmp0_);
	rstate = _tmp0_;
	succ = (GeeConcurrentListNode*) _tmp1_;
	_vala_state = (GeeConcurrentListState) rstate;
	_tmp2_ = succ;
	succ = NULL;
	result = _tmp2_;
	_gee_concurrent_list_node_unref0 (succ);
	if (state) {
		*state = _vala_state;
	}
	return result;
}

static inline void
gee_concurrent_list_node_set_succ (GeeConcurrentListNode* self,
                                   GeeConcurrentListNode* next,
                                   GeeConcurrentListState state)
{
	GeeConcurrentListNode* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _gee_concurrent_list_node_ref0 (next);
	gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->_succ, _tmp0_, (gsize) 3, (gsize) state);
}

static inline GeeConcurrentListNode*
gee_concurrent_list_node_get_backlink (GeeConcurrentListNode* self)
{
	gpointer _tmp0_;
	GeeConcurrentListNode* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_hazard_pointer_get_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->_backlink, (gsize) 0, NULL);
	result = (GeeConcurrentListNode*) _tmp0_;
	return result;
}

static inline void
gee_concurrent_list_node_set_backlink (GeeConcurrentListNode* self,
                                       GeeConcurrentListNode* backlink)
{
	GeeConcurrentListNode* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _gee_concurrent_list_node_ref0 (backlink);
	gee_hazard_pointer_compare_and_exchange_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->_backlink, NULL, _tmp0_, (gsize) 0, (gsize) 0, (gsize) 0);
}

static void
gee_concurrent_list_value_node_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
gee_concurrent_list_value_node_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		gee_concurrent_list_node_unref (value->data[0].v_pointer);
	}
}

static void
gee_concurrent_list_value_node_copy_value (const GValue* src_value,
                                           GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = gee_concurrent_list_node_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
gee_concurrent_list_value_node_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
gee_concurrent_list_value_node_collect_value (GValue* value,
                                              guint n_collect_values,
                                              GTypeCValue* collect_values,
                                              guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		GeeConcurrentListNode * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = gee_concurrent_list_node_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
gee_concurrent_list_value_node_lcopy_value (const GValue* value,
                                            guint n_collect_values,
                                            GTypeCValue* collect_values,
                                            guint collect_flags)
{
	GeeConcurrentListNode ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = gee_concurrent_list_node_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
gee_concurrent_list_param_spec_node (const gchar* name,
                                     const gchar* nick,
                                     const gchar* blurb,
                                     GType object_type,
                                     GParamFlags flags)
{
	GeeConcurrentListParamSpecNode* spec;
	g_return_val_if_fail (g_type_is_a (object_type, GEE_CONCURRENT_LIST_TYPE_NODE), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

static gpointer
gee_concurrent_list_value_get_node (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_LIST_TYPE_NODE), NULL);
	return value->data[0].v_pointer;
}

static void
gee_concurrent_list_value_set_node (GValue* value,
                                    gpointer v_object)
{
	GeeConcurrentListNode * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_LIST_TYPE_NODE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_CONCURRENT_LIST_TYPE_NODE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		gee_concurrent_list_node_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gee_concurrent_list_node_unref (old);
	}
}

static void
gee_concurrent_list_value_take_node (GValue* value,
                                     gpointer v_object)
{
	GeeConcurrentListNode * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, GEE_CONCURRENT_LIST_TYPE_NODE));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, GEE_CONCURRENT_LIST_TYPE_NODE));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		gee_concurrent_list_node_unref (old);
	}
}

static void
gee_concurrent_list_node_class_init (GeeConcurrentListNodeClass * klass,
                                     gpointer klass_data)
{
	gee_concurrent_list_node_parent_class = g_type_class_peek_parent (klass);
	((GeeConcurrentListNodeClass *) klass)->finalize = gee_concurrent_list_node_finalize;
	g_type_class_adjust_private_offset (klass, &GeeConcurrentListNode_private_offset);
}

static void
gee_concurrent_list_node_instance_init (GeeConcurrentListNode * self,
                                        gpointer klass)
{
	self->priv = gee_concurrent_list_node_get_instance_private (self);
	self->ref_count = 1;
}

static void
gee_concurrent_list_node_finalize (GeeConcurrentListNode * obj)
{
	GeeConcurrentListNode * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_CONCURRENT_LIST_TYPE_NODE, GeeConcurrentListNode);
	g_signal_handlers_destroy (self);
	gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->_succ, NULL, (gsize) 3, (gsize) 0);
	gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->_backlink, NULL, (gsize) 0, (gsize) 0);
	gee_hazard_pointer_set_pointer (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, &self->_data, NULL, (gsize) 0, (gsize) 0);
}

static GType
gee_concurrent_list_node_get_type_once (void)
{
	static const GTypeValueTable g_define_type_value_table = { gee_concurrent_list_value_node_init, gee_concurrent_list_value_node_free_value, gee_concurrent_list_value_node_copy_value, gee_concurrent_list_value_node_peek_pointer, "p", gee_concurrent_list_value_node_collect_value, "p", gee_concurrent_list_value_node_lcopy_value };
	static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentListNodeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_list_node_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentListNode), 0, (GInstanceInitFunc) gee_concurrent_list_node_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 gee_concurrent_list_node_type_id;
	gee_concurrent_list_node_type_id = g_type_register_fundamental (g_type_fundamental_next (), "GeeConcurrentListNode", &g_define_type_info, &g_define_type_fundamental_info, 0);
	GeeConcurrentListNode_private_offset = g_type_add_instance_private (gee_concurrent_list_node_type_id, sizeof (GeeConcurrentListNodePrivate));
	return gee_concurrent_list_node_type_id;
}

static GType
gee_concurrent_list_node_get_type (void)
{
	static volatile gsize gee_concurrent_list_node_type_id__once = 0;
	if (g_once_init_enter (&gee_concurrent_list_node_type_id__once)) {
		GType gee_concurrent_list_node_type_id;
		gee_concurrent_list_node_type_id = gee_concurrent_list_node_get_type_once ();
		g_once_init_leave (&gee_concurrent_list_node_type_id__once, gee_concurrent_list_node_type_id);
	}
	return gee_concurrent_list_node_type_id__once;
}

static gpointer
gee_concurrent_list_node_ref (gpointer instance)
{
	GeeConcurrentListNode * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
gee_concurrent_list_node_unref (gpointer instance)
{
	GeeConcurrentListNode * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GEE_CONCURRENT_LIST_NODE_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
gee_concurrent_list_class_init (GeeConcurrentListClass * klass,
                                gpointer klass_data)
{
	gee_concurrent_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GeeConcurrentList_private_offset);
	((GeeAbstractCollectionClass *) klass)->contains = (gboolean (*) (GeeAbstractCollection*, gconstpointer)) gee_concurrent_list_real_contains;
	((GeeAbstractCollectionClass *) klass)->add = (gboolean (*) (GeeAbstractCollection*, gconstpointer)) gee_concurrent_list_real_add;
	((GeeAbstractCollectionClass *) klass)->remove = (gboolean (*) (GeeAbstractCollection*, gconstpointer)) gee_concurrent_list_real_remove;
	((GeeAbstractCollectionClass *) klass)->clear = (void (*) (GeeAbstractCollection*)) gee_concurrent_list_real_clear;
	((GeeAbstractCollectionClass *) klass)->iterator = (GeeIterator* (*) (GeeAbstractCollection*)) gee_concurrent_list_real_iterator;
	((GeeAbstractListClass *) klass)->list_iterator = (GeeListIterator* (*) (GeeAbstractList*)) gee_concurrent_list_real_list_iterator;
	((GeeAbstractListClass *) klass)->get = (gpointer (*) (GeeAbstractList*, gint)) gee_concurrent_list_real_get;
	((GeeAbstractListClass *) klass)->set = (void (*) (GeeAbstractList*, gint, gconstpointer)) gee_concurrent_list_real_set;
	((GeeAbstractListClass *) klass)->index_of = (gint (*) (GeeAbstractList*, gconstpointer)) gee_concurrent_list_real_index_of;
	((GeeAbstractListClass *) klass)->insert = (void (*) (GeeAbstractList*, gint, gconstpointer)) gee_concurrent_list_real_insert;
	((GeeAbstractListClass *) klass)->remove_at = (gpointer (*) (GeeAbstractList*, gint)) gee_concurrent_list_real_remove_at;
	((GeeAbstractListClass *) klass)->slice = (GeeList* (*) (GeeAbstractList*, gint, gint)) gee_concurrent_list_real_slice;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = (gboolean (*) (GeeAbstractCollection*)) gee_concurrent_list_real_get_read_only;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = (gint (*) (GeeAbstractCollection*)) gee_concurrent_list_real_get_size;
	G_OBJECT_CLASS (klass)->get_property = _vala_gee_concurrent_list_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gee_concurrent_list_set_property;
	G_OBJECT_CLASS (klass)->finalize = gee_concurrent_list_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_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), GEE_CONCURRENT_LIST_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), GEE_CONCURRENT_LIST_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));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_READ_ONLY_PROPERTY, gee_concurrent_list_properties[GEE_CONCURRENT_LIST_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_SIZE_PROPERTY, gee_concurrent_list_properties[GEE_CONCURRENT_LIST_SIZE_PROPERTY] = g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_CONCURRENT_LIST_IS_EMPTY_PROPERTY, gee_concurrent_list_properties[GEE_CONCURRENT_LIST_IS_EMPTY_PROPERTY] = g_param_spec_boolean ("is-empty", "is-empty", "is-empty", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gee_concurrent_list_instance_init (GeeConcurrentList * self,
                                   gpointer klass)
{
	self->priv = gee_concurrent_list_get_instance_private (self);
}

static void
gee_concurrent_list_finalize (GObject * obj)
{
	GeeConcurrentList * self;
	GeeHazardPointerContext* ctx = NULL;
	GeeHazardPointerContext* _tmp0_;
	GeeHazardPointerContext* _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_TYPE_CONCURRENT_LIST, GeeConcurrentList);
	_tmp0_ = gee_hazard_pointer_context_new (NULL);
	ctx = _tmp0_;
	_tmp1_ = ctx;
	gee_utils_misc_unused (_tmp1_);
	_gee_concurrent_list_node_unref0 (self->priv->_head);
	self->priv->_head = NULL;
	gee_hazard_pointer_set_pointer (GEE_CONCURRENT_LIST_TYPE_NODE, (GBoxedCopyFunc) gee_concurrent_list_node_ref, (GDestroyNotify) gee_concurrent_list_node_unref, &self->priv->_tail, NULL, (gsize) 0, (gsize) 0);
	_gee_hazard_pointer_context_free0 (ctx);
	_gee_concurrent_list_node_unref0 (self->priv->_head);
	_gee_functions_equal_data_func_closure_unref0 (self->priv->_equal_func);
	G_OBJECT_CLASS (gee_concurrent_list_parent_class)->finalize (obj);
}

/**
 * A single-linked list. This implementation is based on
 * [[http://www.cse.yorku.ca/~ruppert/papers/lfll.pdf|Mikhail Fomitchev and  Eric Ruppert paper ]].
 *
 * Many threads are allowed to operate on the same structure as well as modification
 * of structure during iteration is allowed. However the change may not be immediately
 * visible to other threads.
 */
static GType
gee_concurrent_list_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GeeConcurrentListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_concurrent_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeConcurrentList), 0, (GInstanceInitFunc) gee_concurrent_list_instance_init, NULL };
	GType gee_concurrent_list_type_id;
	gee_concurrent_list_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_LIST, "GeeConcurrentList", &g_define_type_info, 0);
	GeeConcurrentList_private_offset = g_type_add_instance_private (gee_concurrent_list_type_id, sizeof (GeeConcurrentListPrivate));
	return gee_concurrent_list_type_id;
}

GType
gee_concurrent_list_get_type (void)
{
	static volatile gsize gee_concurrent_list_type_id__once = 0;
	if (g_once_init_enter (&gee_concurrent_list_type_id__once)) {
		GType gee_concurrent_list_type_id;
		gee_concurrent_list_type_id = gee_concurrent_list_get_type_once ();
		g_once_init_leave (&gee_concurrent_list_type_id__once, gee_concurrent_list_type_id);
	}
	return gee_concurrent_list_type_id__once;
}

static void
_vala_gee_concurrent_list_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	GeeConcurrentList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_CONCURRENT_LIST, GeeConcurrentList);
	switch (property_id) {
		case GEE_CONCURRENT_LIST_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self));
		break;
		case GEE_CONCURRENT_LIST_SIZE_PROPERTY:
		g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self));
		break;
		case GEE_CONCURRENT_LIST_IS_EMPTY_PROPERTY:
		g_value_set_boolean (value, gee_concurrent_list_get_is_empty (self));
		break;
		case GEE_CONCURRENT_LIST_G_TYPE:
		g_value_set_gtype (value, self->priv->g_type);
		break;
		case GEE_CONCURRENT_LIST_G_DUP_FUNC:
		g_value_set_pointer (value, self->priv->g_dup_func);
		break;
		case GEE_CONCURRENT_LIST_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_gee_concurrent_list_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	GeeConcurrentList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_TYPE_CONCURRENT_LIST, GeeConcurrentList);
	switch (property_id) {
		case GEE_CONCURRENT_LIST_G_TYPE:
		self->priv->g_type = g_value_get_gtype (value);
		break;
		case GEE_CONCURRENT_LIST_G_DUP_FUNC:
		self->priv->g_dup_func = g_value_get_pointer (value);
		break;
		case GEE_CONCURRENT_LIST_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;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

