00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __G_ASYNCQUEUE_H__
00029 #define __G_ASYNCQUEUE_H__
00030
00031 #include <_ansi.h>
00032 #include <glib/gthread.h>
00033
00034 G_BEGIN_DECLS
00035
00036 typedef struct _GAsyncQueue GAsyncQueue;
00037
00038
00039
00040
00041 IMPORT_C GAsyncQueue* g_async_queue_new (void);
00042
00043
00044
00045
00046
00047 IMPORT_C void g_async_queue_lock (GAsyncQueue *queue);
00048 IMPORT_C void g_async_queue_unlock (GAsyncQueue *queue);
00049
00050
00051 IMPORT_C GAsyncQueue* g_async_queue_ref (GAsyncQueue *queue);
00052 IMPORT_C void g_async_queue_unref (GAsyncQueue *queue);
00053
00054 #ifndef G_DISABLE_DEPRECATED
00055
00056 IMPORT_C void g_async_queue_ref_unlocked (GAsyncQueue *queue);
00057 IMPORT_C void g_async_queue_unref_and_unlock (GAsyncQueue *queue);
00058 #endif
00059
00060
00061 IMPORT_C void g_async_queue_push (GAsyncQueue *queue,
00062 gpointer data);
00063 IMPORT_C void g_async_queue_push_unlocked (GAsyncQueue *queue,
00064 gpointer data);
00065
00066 IMPORT_C void g_async_queue_push_sorted (GAsyncQueue *queue,
00067 gpointer data,
00068 GCompareDataFunc func,
00069 gpointer user_data);
00070 IMPORT_C void g_async_queue_push_sorted_unlocked (GAsyncQueue *queue,
00071 gpointer data,
00072 GCompareDataFunc func,
00073 gpointer user_data);
00074
00075
00076
00077
00078 IMPORT_C gpointer g_async_queue_pop (GAsyncQueue *queue);
00079 IMPORT_C gpointer g_async_queue_pop_unlocked (GAsyncQueue *queue);
00080
00081
00082 IMPORT_C gpointer g_async_queue_try_pop (GAsyncQueue *queue);
00083 IMPORT_C gpointer g_async_queue_try_pop_unlocked (GAsyncQueue *queue);
00084
00085
00086
00087
00088
00089
00090 IMPORT_C gpointer g_async_queue_timed_pop (GAsyncQueue *queue,
00091 GTimeVal *end_time);
00092 IMPORT_C gpointer g_async_queue_timed_pop_unlocked (GAsyncQueue *queue,
00093 GTimeVal *end_time);
00094
00095
00096
00097
00098
00099
00100
00101
00102 IMPORT_C gint g_async_queue_length (GAsyncQueue *queue);
00103 IMPORT_C gint g_async_queue_length_unlocked (GAsyncQueue *queue);
00104 IMPORT_C void g_async_queue_sort (GAsyncQueue *queue,
00105 GCompareDataFunc func,
00106 gpointer user_data);
00107 IMPORT_C void g_async_queue_sort_unlocked (GAsyncQueue *queue,
00108 GCompareDataFunc func,
00109 gpointer user_data);
00110
00111
00112 GMutex* _g_async_queue_get_mutex (GAsyncQueue *queue);
00113
00114 G_END_DECLS
00115
00116 #endif
00117