1 /* 2 * Distributed under the Boost Software License, Version 1.0. 3 * (See accompanying file LICENSE_1_0.txt or copy at 4 * http://www.boost.org/LICENSE_1_0.txt) 5 */ 6 module glib.gasyncqueue; 7 8 import glib.gtypes; 9 import glib.gthread; 10 11 12 13 struct GAsyncQueue; 14 15 extern(C) { 16 17 GAsyncQueue *g_async_queue_new (); 18 19 GAsyncQueue *g_async_queue_new_full (GDestroyNotify item_free_func); 20 21 void g_async_queue_lock (GAsyncQueue *queue); 22 23 void g_async_queue_unlock (GAsyncQueue *queue); 24 25 GAsyncQueue *g_async_queue_ref (GAsyncQueue *queue); 26 27 void g_async_queue_unref (GAsyncQueue *queue); 28 29 deprecated("use g_async_queue_ref") 30 void g_async_queue_ref_unlocked (GAsyncQueue *queue); 31 32 deprecated("use g_async_queue_unref") 33 void g_async_queue_unref_and_unlock (GAsyncQueue *queue); 34 35 36 void g_async_queue_push (GAsyncQueue *queue, gpointer data); 37 38 void g_async_queue_push_unlocked (GAsyncQueue *queue, gpointer data); 39 40 void g_async_queue_push_sorted (GAsyncQueue *queue, 41 gpointer data, 42 GCompareDataFunc func, 43 gpointer user_data); 44 45 void g_async_queue_push_sorted_unlocked (GAsyncQueue *queue, 46 gpointer data, 47 GCompareDataFunc func, 48 gpointer user_data); 49 50 gpointer g_async_queue_pop (GAsyncQueue *queue); 51 52 gpointer g_async_queue_pop_unlocked (GAsyncQueue *queue); 53 54 gpointer g_async_queue_try_pop (GAsyncQueue *queue); 55 56 gpointer g_async_queue_try_pop_unlocked (GAsyncQueue *queue); 57 58 gpointer g_async_queue_timeout_pop (GAsyncQueue *queue, guint64 timeout); 59 60 gpointer g_async_queue_timeout_pop_unlocked (GAsyncQueue *queue, 61 guint64 timeout); 62 63 gint g_async_queue_length (GAsyncQueue *queue); 64 65 gint g_async_queue_length_unlocked (GAsyncQueue *queue); 66 67 void g_async_queue_sort (GAsyncQueue *queue, 68 GCompareDataFunc func, 69 gpointer user_data); 70 71 void g_async_queue_sort_unlocked (GAsyncQueue *queue, 72 GCompareDataFunc func, 73 gpointer user_data); 74 75 deprecated("use g_async_queue_timeout_pop") 76 gpointer g_async_queue_timed_pop (GAsyncQueue *queue, GTimeVal *end_time); 77 78 deprecated("use g_async_queue_timeout_pop_unlocked") 79 gpointer g_async_queue_timed_pop_unlocked (GAsyncQueue *queue, 80 GTimeVal *end_time); 81 82 } 83