+ GAsyncQueue *q;
+ gpointer item;
+
+ destroy_count = 0;
+
+ q = g_async_queue_new_full (counting_destroy);
+ g_async_queue_lock (q);
+ g_async_queue_ref (q);
+ g_async_queue_unlock (q);
+ g_async_queue_lock (q);
+ g_async_queue_ref_unlocked (q);
+ g_async_queue_unref_and_unlock (q);
+
+ item = g_async_queue_try_pop (q);
+ g_assert (item == NULL);
+
+ g_async_queue_lock (q);
+ item = g_async_queue_try_pop_unlocked (q);
+ g_async_queue_unlock (q);
+ g_assert (item == NULL);
+
+ g_async_queue_push (q, GINT_TO_POINTER (1));
+ g_async_queue_push (q, GINT_TO_POINTER (2));
+ g_async_queue_push (q, GINT_TO_POINTER (3));
+ g_assert_cmpint (destroy_count, ==, 0);
+
+ g_async_queue_unref (q);
+ g_assert_cmpint (destroy_count, ==, 0);
+
+ item = g_async_queue_pop (q);
+ g_assert_cmpint (GPOINTER_TO_INT (item), ==, 1);
+ g_assert_cmpint (destroy_count, ==, 0);
+
+ g_async_queue_unref (q);
+ g_assert_cmpint (destroy_count, ==, 2);
+}
+
+int
+main (int argc, char *argv[])
+{
+ gint i;
+ gint max_threads = MAX_THREADS;
+ gint max_unused_threads = MAX_THREADS;
+ gint sort_multiplier = MAX_SORTS;
+ gint sort_interval;
+ gchar *msg G_GNUC_UNUSED;