~ubuntu-branches/debian/squeeze/glib2.0/squeeze

« back to all changes in this revision

Viewing changes to docs/reference/glib/html/glib-Asynchronous-Queues.html

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mfrom: (1.3.1 upstream) (69.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20090215130043-q47fbt3owmt42m2f
Tags: 2.18.4-2
* Release to unstable
* debian/rules:
- bump SHVER, since we are already forcing a 2.18.0 dependecy on the
  symbols introduced in the development versions
* debian/control.in:
- added Homepage and Vcs-* control fields

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
2
<html>
3
3
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>Asynchronous Queues</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
 
<link rel="start" href="index.html" title="GLib Reference Manual">
 
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
 
7
<link rel="home" href="index.html" title="GLib Reference Manual">
8
8
<link rel="up" href="glib-core.html" title="GLib Core Application Support">
9
9
<link rel="prev" href="glib-Thread-Pools.html" title="Thread Pools">
10
10
<link rel="next" href="glib-Dynamic-Loading-of-Modules.html" title="Dynamic Loading of Modules">
11
 
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="glib.html" title="GLib Overview">
14
14
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
26
26
<link rel="index" href="ix08.html" title="Index of new symbols in 2.12">
27
27
<link rel="index" href="ix09.html" title="Index of new symbols in 2.14">
28
28
<link rel="index" href="ix10.html" title="Index of new symbols in 2.16">
 
29
<link rel="index" href="ix11.html" title="Index of new symbols in 2.18">
29
30
</head>
30
31
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
31
32
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="glib-Dynamic-Loading-of-Modules.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
38
39
</tr>
39
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2966151" class="shortcut">Top</a>
40
 
                  &#160;|&#160;
41
 
                  <a href="#id2966777" class="shortcut">Description</a></nobr></td></tr>
 
40
<tr><td colspan="5" class="shortcuts">
 
41
<a href="#glib-Asynchronous-Queues.synopsis" class="shortcut">Top</a>
 
42
                 | 
 
43
                <a href="#glib-Asynchronous-Queues.description" class="shortcut">Description</a>
 
44
</td></tr>
42
45
</table>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-Asynchronous-Queues"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
46
49
<td valign="top">
47
 
<h2>
48
 
<a name="id2966151"></a><span class="refentrytitle">Asynchronous Queues</span>
49
 
</h2>
50
 
<p>Asynchronous Queues &#8212; asynchronous communication between threads</p>
 
50
<h2><span class="refentrytitle"><a name="glib-Asynchronous-Queues.top_of_page"></a>Asynchronous Queues</span></h2>
 
51
<p>Asynchronous Queues — asynchronous communication between threads</p>
51
52
</td>
52
53
<td valign="top" align="right"></td>
53
54
</tr></table></div>
54
55
<div class="refsynopsisdiv">
55
 
<h2>Synopsis</h2>
 
56
<a name="glib-Asynchronous-Queues.synopsis"></a><h2>Synopsis</h2>
56
57
<pre class="synopsis">
57
58
 
58
59
#include &lt;glib.h&gt;
59
60
 
60
 
 
61
 
                    <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a>;
62
 
<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a>*        <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-new">g_async_queue_new</a>                   (void);
63
 
<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a>*        <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-new-full">g_async_queue_new_full</a>              (<a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> item_free_func);
64
 
<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a>*        <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-ref">g_async_queue_ref</a>                   (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
65
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unref">g_async_queue_unref</a>                 (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
66
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push">g_async_queue_push</a>                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
67
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
68
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push-sorted">g_async_queue_push_sorted</a>           (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
69
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
70
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> func,
71
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
72
 
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-pop">g_async_queue_pop</a>                   (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
73
 
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-try-pop">g_async_queue_try_pop</a>               (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
74
 
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-timed-pop">g_async_queue_timed_pop</a>             (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
75
 
                                                         <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a> *end_time);
76
 
<a class="link" href="glib-Basic-Types.html#gint">gint</a>                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-length">g_async_queue_length</a>                (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
77
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-sort">g_async_queue_sort</a>                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
78
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> func,
79
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
80
 
 
81
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-lock">g_async_queue_lock</a>                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
82
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unlock">g_async_queue_unlock</a>                (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
83
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-ref-unlocked">g_async_queue_ref_unlocked</a>          (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
84
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unref-and-unlock">g_async_queue_unref_and_unlock</a>      (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
85
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push-unlocked">g_async_queue_push_unlocked</a>         (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
86
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);
87
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push-sorted-unlocked">g_async_queue_push_sorted_unlocked</a>  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
88
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
89
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> func,
90
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
91
 
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-pop-unlocked">g_async_queue_pop_unlocked</a>          (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
92
 
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-try-pop-unlocked">g_async_queue_try_pop_unlocked</a>      (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
93
 
<a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-timed-pop-unlocked">g_async_queue_timed_pop_unlocked</a>    (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
94
 
                                                         <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a> *end_time);
95
 
<a class="link" href="glib-Basic-Types.html#gint">gint</a>                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-length-unlocked">g_async_queue_length_unlocked</a>       (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);
96
 
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-sort-unlocked">g_async_queue_sort_unlocked</a>         (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
97
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> func,
98
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);
 
61
                    <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a>;
 
62
<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a>*        <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-new" title="g_async_queue_new ()">g_async_queue_new</a>                   (void);
 
63
<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a>*        <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-new-full" title="g_async_queue_new_full ()">g_async_queue_new_full</a>              (<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> item_free_func);
 
64
<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a>*        <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-ref" title="g_async_queue_ref ()">g_async_queue_ref</a>                   (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
65
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unref" title="g_async_queue_unref ()">g_async_queue_unref</a>                 (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
66
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push" title="g_async_queue_push ()">g_async_queue_push</a>                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
67
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
 
68
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push-sorted" title="g_async_queue_push_sorted ()">g_async_queue_push_sorted</a>           (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
69
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
70
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> func,
 
71
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
 
72
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-pop" title="g_async_queue_pop ()">g_async_queue_pop</a>                   (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
73
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-try-pop" title="g_async_queue_try_pop ()">g_async_queue_try_pop</a>               (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
74
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-timed-pop" title="g_async_queue_timed_pop ()">g_async_queue_timed_pop</a>             (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
75
                                                         <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a> *end_time);
 
76
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a>                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-length" title="g_async_queue_length ()">g_async_queue_length</a>                (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
77
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-sort" title="g_async_queue_sort ()">g_async_queue_sort</a>                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
78
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> func,
 
79
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
 
80
 
 
81
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-lock" title="g_async_queue_lock ()">g_async_queue_lock</a>                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
82
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unlock" title="g_async_queue_unlock ()">g_async_queue_unlock</a>                (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
83
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-ref-unlocked" title="g_async_queue_ref_unlocked ()">g_async_queue_ref_unlocked</a>          (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
84
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unref-and-unlock" title="g_async_queue_unref_and_unlock ()">g_async_queue_unref_and_unlock</a>      (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
85
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push-unlocked" title="g_async_queue_push_unlocked ()">g_async_queue_push_unlocked</a>         (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
86
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);
 
87
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push-sorted-unlocked" title="g_async_queue_push_sorted_unlocked ()">g_async_queue_push_sorted_unlocked</a>  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
88
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
89
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> func,
 
90
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
 
91
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-pop-unlocked" title="g_async_queue_pop_unlocked ()">g_async_queue_pop_unlocked</a>          (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
92
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-try-pop-unlocked" title="g_async_queue_try_pop_unlocked ()">g_async_queue_try_pop_unlocked</a>      (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
93
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-timed-pop-unlocked" title="g_async_queue_timed_pop_unlocked ()">g_async_queue_timed_pop_unlocked</a>    (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
94
                                                         <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a> *end_time);
 
95
<a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a>                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-length-unlocked" title="g_async_queue_length_unlocked ()">g_async_queue_length_unlocked</a>       (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);
 
96
void                <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-sort-unlocked" title="g_async_queue_sort_unlocked ()">g_async_queue_sort_unlocked</a>         (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
97
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> func,
 
98
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);
99
99
</pre>
100
100
</div>
101
101
<div class="refsect1" lang="en">
102
 
<a name="id2966777"></a><h2>Description</h2>
 
102
<a name="glib-Asynchronous-Queues.description"></a><h2>Description</h2>
103
103
<p>
104
104
Often you need to communicate between different threads. In general
105
105
it's safer not to do this by shared memory, but by explicit message
116
116
</p>
117
117
<p>
118
118
For using an asynchronous queue you first have to create one with
119
 
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-new"><code class="function">g_async_queue_new()</code></a>. A newly-created queue will get the reference
 
119
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-new" title="g_async_queue_new ()"><code class="function">g_async_queue_new()</code></a>. A newly-created queue will get the reference
120
120
count 1. Whenever another thread is creating a new reference of (that
121
121
is, pointer to) the queue, it has to increase the reference count
122
 
(using <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-ref"><code class="function">g_async_queue_ref()</code></a>). Also, before removing this reference, the
 
122
(using <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-ref" title="g_async_queue_ref ()"><code class="function">g_async_queue_ref()</code></a>). Also, before removing this reference, the
123
123
reference count has to be decreased (using
124
 
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unref"><code class="function">g_async_queue_unref()</code></a>). After that the queue might no longer exist so
 
124
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unref" title="g_async_queue_unref ()"><code class="function">g_async_queue_unref()</code></a>). After that the queue might no longer exist so
125
125
you must not access it after that point.
126
126
</p>
127
127
<p>
128
128
A thread, which wants to send a message to that queue simply calls
129
 
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push"><code class="function">g_async_queue_push()</code></a> to push the message to the queue.
 
129
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-push" title="g_async_queue_push ()"><code class="function">g_async_queue_push()</code></a> to push the message to the queue.
130
130
</p>
131
131
<p>
132
132
A thread, which is expecting messages from an asynchronous queue
133
 
simply calls <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-pop"><code class="function">g_async_queue_pop()</code></a> for that queue. If no message is
 
133
simply calls <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-pop" title="g_async_queue_pop ()"><code class="function">g_async_queue_pop()</code></a> for that queue. If no message is
134
134
available in the queue at that point, the thread is now put to sleep
135
135
until a message arrives. The message will be removed from the queue
136
 
and returned. The functions <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-try-pop"><code class="function">g_async_queue_try_pop()</code></a> and
137
 
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-timed-pop"><code class="function">g_async_queue_timed_pop()</code></a> can be used to only check for the presence
 
136
and returned. The functions <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-try-pop" title="g_async_queue_try_pop ()"><code class="function">g_async_queue_try_pop()</code></a> and
 
137
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-timed-pop" title="g_async_queue_timed_pop ()"><code class="function">g_async_queue_timed_pop()</code></a> can be used to only check for the presence
138
138
of messages or to only wait a certain time for messages respectively.
139
139
</p>
140
140
<p>
141
141
For almost every function there exist two variants, one that locks the
142
142
queue and one that doesn't. That way you can hold the queue lock
143
 
(acquire it with <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-lock"><code class="function">g_async_queue_lock()</code></a> and release it with
144
 
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unlock"><code class="function">g_async_queue_unlock()</code></a>) over multiple queue accessing
 
143
(acquire it with <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-lock" title="g_async_queue_lock ()"><code class="function">g_async_queue_lock()</code></a> and release it with
 
144
<a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unlock" title="g_async_queue_unlock ()"><code class="function">g_async_queue_unlock()</code></a>) over multiple queue accessing
145
145
instructions. This can be necessary to ensure the integrity of the
146
146
queue, but should only be used when really necessary, as it can make
147
147
your life harder if used unwisely. Normally you should only use the
149
149
</p>
150
150
</div>
151
151
<div class="refsect1" lang="en">
152
 
<a name="id2966938"></a><h2>Details</h2>
 
152
<a name="glib-Asynchronous-Queues.details"></a><h2>Details</h2>
153
153
<div class="refsect2" lang="en">
154
 
<a name="id2966948"></a><h3>
155
 
<a name="GAsyncQueue"></a>GAsyncQueue</h3>
156
 
<a class="indexterm" name="id2966960"></a><pre class="programlisting">typedef struct _GAsyncQueue GAsyncQueue;</pre>
 
154
<a name="GAsyncQueue"></a><h3>GAsyncQueue</h3>
 
155
<pre class="programlisting">typedef struct _GAsyncQueue GAsyncQueue;</pre>
157
156
<p>
158
 
The <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a> struct is an opaque data structure, which represents
 
157
The <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a> struct is an opaque data structure, which represents
159
158
an asynchronous queue. It should only be accessed through the
160
159
<code class="function">g_async_queue_*</code> functions.
161
160
</p>
162
161
</div>
163
162
<hr>
164
163
<div class="refsect2" lang="en">
165
 
<a name="id2966992"></a><h3>
166
 
<a name="g-async-queue-new"></a>g_async_queue_new ()</h3>
167
 
<a class="indexterm" name="id2967006"></a><pre class="programlisting"><a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a>*        g_async_queue_new                   (void);</pre>
 
164
<a name="g-async-queue-new"></a><h3>g_async_queue_new ()</h3>
 
165
<pre class="programlisting"><a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a>*        g_async_queue_new                   (void);</pre>
168
166
<p>
169
167
Creates a new asynchronous queue with the initial reference count of 1.</p>
170
168
<div class="variablelist"><table border="0">
171
169
<col align="left" valign="top">
172
170
<tbody><tr>
173
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
174
 
<td> the new <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
171
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
172
<td> the new <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
175
173
</td>
176
174
</tr></tbody>
177
175
</table></div>
178
176
</div>
179
177
<hr>
180
178
<div class="refsect2" lang="en">
181
 
<a name="id2967052"></a><h3>
182
 
<a name="g-async-queue-new-full"></a>g_async_queue_new_full ()</h3>
183
 
<a class="indexterm" name="id2967067"></a><pre class="programlisting"><a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a>*        g_async_queue_new_full              (<a class="link" href="glib-Datasets.html#GDestroyNotify">GDestroyNotify</a> item_free_func);</pre>
 
179
<a name="g-async-queue-new-full"></a><h3>g_async_queue_new_full ()</h3>
 
180
<pre class="programlisting"><a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a>*        g_async_queue_new_full              (<a class="link" href="glib-Datasets.html#GDestroyNotify" title="GDestroyNotify ()">GDestroyNotify</a> item_free_func);</pre>
184
181
<p>
185
182
Creates a new asynchronous queue with an initial reference count of 1 and
186
183
sets up a destroy notify function that is used to free any remaining
187
184
queue items when the queue is destroyed after the final unref.</p>
188
185
<p>
189
 
 
190
186
</p>
191
187
<div class="variablelist"><table border="0">
192
188
<col align="left" valign="top">
193
189
<tbody>
194
190
<tr>
195
 
<td><p><span class="term"><em class="parameter"><code>item_free_func</code></em>&#160;:</span></p></td>
 
191
<td><p><span class="term"><em class="parameter"><code>item_free_func</code></em> :</span></p></td>
196
192
<td> function to free queue elements
197
193
</td>
198
194
</tr>
199
195
<tr>
200
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
201
 
<td> the new <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
196
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
197
<td> the new <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
202
198
 
203
199
</td>
204
200
</tr>
205
201
</tbody>
206
202
</table></div>
207
 
<p class="since">Since  2.16
208
 
</p>
 
203
<p class="since">Since 2.16</p>
209
204
</div>
210
205
<hr>
211
206
<div class="refsect2" lang="en">
212
 
<a name="id2967147"></a><h3>
213
 
<a name="g-async-queue-ref"></a>g_async_queue_ref ()</h3>
214
 
<a class="indexterm" name="id2967160"></a><pre class="programlisting"><a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a>*        g_async_queue_ref                   (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
207
<a name="g-async-queue-ref"></a><h3>g_async_queue_ref ()</h3>
 
208
<pre class="programlisting"><a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a>*        g_async_queue_ref                   (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
215
209
<p>
216
210
Increases the reference count of the asynchronous <em class="parameter"><code>queue</code></em> by 1. You
217
211
do not need to hold the lock to call this function.</p>
219
213
<col align="left" valign="top">
220
214
<tbody>
221
215
<tr>
222
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
223
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
216
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
217
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
224
218
</td>
225
219
</tr>
226
220
<tr>
227
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
221
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
228
222
<td> the <em class="parameter"><code>queue</code></em> that was passed in (since 2.6)
229
223
</td>
230
224
</tr>
233
227
</div>
234
228
<hr>
235
229
<div class="refsect2" lang="en">
236
 
<a name="id2967239"></a><h3>
237
 
<a name="g-async-queue-unref"></a>g_async_queue_unref ()</h3>
238
 
<a class="indexterm" name="id2967253"></a><pre class="programlisting">void                g_async_queue_unref                 (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
230
<a name="g-async-queue-unref"></a><h3>g_async_queue_unref ()</h3>
 
231
<pre class="programlisting">void                g_async_queue_unref                 (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
239
232
<p>
240
233
Decreases the reference count of the asynchronous <em class="parameter"><code>queue</code></em> by 1. If
241
234
the reference count went to 0, the <em class="parameter"><code>queue</code></em> will be destroyed and the
245
238
<div class="variablelist"><table border="0">
246
239
<col align="left" valign="top">
247
240
<tbody><tr>
248
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
249
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
241
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
242
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
250
243
</td>
251
244
</tr></tbody>
252
245
</table></div>
253
246
</div>
254
247
<hr>
255
248
<div class="refsect2" lang="en">
256
 
<a name="id2967330"></a><h3>
257
 
<a name="g-async-queue-push"></a>g_async_queue_push ()</h3>
258
 
<a class="indexterm" name="id2967343"></a><pre class="programlisting">void                g_async_queue_push                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
259
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
 
249
<a name="g-async-queue-push"></a><h3>g_async_queue_push ()</h3>
 
250
<pre class="programlisting">void                g_async_queue_push                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
251
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);</pre>
260
252
<p>
261
 
Pushes the <em class="parameter"><code>data</code></em> into the <em class="parameter"><code>queue</code></em>. <em class="parameter"><code>data</code></em> must not be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</p>
 
253
Pushes the <em class="parameter"><code>data</code></em> into the <em class="parameter"><code>queue</code></em>. <em class="parameter"><code>data</code></em> must not be <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>.</p>
262
254
<div class="variablelist"><table border="0">
263
255
<col align="left" valign="top">
264
256
<tbody>
265
257
<tr>
266
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
267
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
258
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
259
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
268
260
</td>
269
261
</tr>
270
262
<tr>
271
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
 
263
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
272
264
<td> <em class="parameter"><code>data</code></em> to push into the <em class="parameter"><code>queue</code></em>.
273
265
</td>
274
266
</tr>
277
269
</div>
278
270
<hr>
279
271
<div class="refsect2" lang="en">
280
 
<a name="id2967459"></a><h3>
281
 
<a name="g-async-queue-push-sorted"></a>g_async_queue_push_sorted ()</h3>
282
 
<a class="indexterm" name="id2967475"></a><pre class="programlisting">void                g_async_queue_push_sorted           (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
283
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
284
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> func,
285
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
 
272
<a name="g-async-queue-push-sorted"></a><h3>g_async_queue_push_sorted ()</h3>
 
273
<pre class="programlisting">void                g_async_queue_push_sorted           (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
274
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
275
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> func,
 
276
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
286
277
<p>
287
278
Inserts <em class="parameter"><code>data</code></em> into <em class="parameter"><code>queue</code></em> using <em class="parameter"><code>func</code></em> to determine the new
288
279
position. 
296
287
it when it is finished.
297
288
</p>
298
289
<p>
299
 
For an example of <em class="parameter"><code>func</code></em> see <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-sort"><code class="function">g_async_queue_sort()</code></a>.</p>
 
290
For an example of <em class="parameter"><code>func</code></em> see <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-sort" title="g_async_queue_sort ()"><code class="function">g_async_queue_sort()</code></a>.</p>
300
291
<p>
301
 
 
302
292
</p>
303
293
<div class="variablelist"><table border="0">
304
294
<col align="left" valign="top">
305
295
<tbody>
306
296
<tr>
307
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
308
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>
 
297
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
298
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>
309
299
</td>
310
300
</tr>
311
301
<tr>
312
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
 
302
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
313
303
<td> the <em class="parameter"><code>data</code></em> to push into the <em class="parameter"><code>queue</code></em>
314
304
</td>
315
305
</tr>
316
306
<tr>
317
 
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
318
 
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc"><span class="type">GCompareDataFunc</span></a> is used to sort <em class="parameter"><code>queue</code></em>. This function
 
307
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
 
308
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> is used to sort <em class="parameter"><code>queue</code></em>. This function
319
309
    is passed two elements of the <em class="parameter"><code>queue</code></em>. The function should return
320
310
    0 if they are equal, a negative value if the first element
321
311
    should be higher in the <em class="parameter"><code>queue</code></em> or a positive value if the first
323
313
</td>
324
314
</tr>
325
315
<tr>
326
 
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
 
316
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
327
317
<td> user data passed to <em class="parameter"><code>func</code></em>.
328
318
</td>
329
319
</tr>
330
320
</tbody>
331
321
</table></div>
332
 
<p class="since">Since  2.10
333
 
</p>
 
322
<p class="since">Since 2.10</p>
334
323
</div>
335
324
<hr>
336
325
<div class="refsect2" lang="en">
337
 
<a name="id2967719"></a><h3>
338
 
<a name="g-async-queue-pop"></a>g_async_queue_pop ()</h3>
339
 
<a class="indexterm" name="id2967732"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_async_queue_pop                   (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
326
<a name="g-async-queue-pop"></a><h3>g_async_queue_pop ()</h3>
 
327
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            g_async_queue_pop                   (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
340
328
<p>
341
329
Pops data from the <em class="parameter"><code>queue</code></em>. This function blocks until data become
342
330
available.</p>
344
332
<col align="left" valign="top">
345
333
<tbody>
346
334
<tr>
347
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
348
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
335
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
336
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
349
337
</td>
350
338
</tr>
351
339
<tr>
352
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
340
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
353
341
<td> data from the queue.
354
342
</td>
355
343
</tr>
358
346
</div>
359
347
<hr>
360
348
<div class="refsect2" lang="en">
361
 
<a name="id2967804"></a><h3>
362
 
<a name="g-async-queue-try-pop"></a>g_async_queue_try_pop ()</h3>
363
 
<a class="indexterm" name="id2967818"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_async_queue_try_pop               (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
349
<a name="g-async-queue-try-pop"></a><h3>g_async_queue_try_pop ()</h3>
 
350
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            g_async_queue_try_pop               (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
364
351
<p>
365
 
Tries to pop data from the <em class="parameter"><code>queue</code></em>. If no data is available, <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is
 
352
Tries to pop data from the <em class="parameter"><code>queue</code></em>. If no data is available, <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> is
366
353
returned.</p>
367
354
<div class="variablelist"><table border="0">
368
355
<col align="left" valign="top">
369
356
<tbody>
370
357
<tr>
371
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
372
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
358
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
359
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
373
360
</td>
374
361
</tr>
375
362
<tr>
376
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
377
 
<td> data from the queue or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, when no data is
 
363
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
364
<td> data from the queue or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, when no data is
378
365
available immediately.
379
366
</td>
380
367
</tr>
383
370
</div>
384
371
<hr>
385
372
<div class="refsect2" lang="en">
386
 
<a name="id2967911"></a><h3>
387
 
<a name="g-async-queue-timed-pop"></a>g_async_queue_timed_pop ()</h3>
388
 
<a class="indexterm" name="id2967924"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_async_queue_timed_pop             (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
389
 
                                                         <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a> *end_time);</pre>
 
373
<a name="g-async-queue-timed-pop"></a><h3>g_async_queue_timed_pop ()</h3>
 
374
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            g_async_queue_timed_pop             (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
375
                                                         <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a> *end_time);</pre>
390
376
<p>
391
377
Pops data from the <em class="parameter"><code>queue</code></em>. If no data is received before <em class="parameter"><code>end_time</code></em>,
392
 
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned.
 
378
<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> is returned.
393
379
</p>
394
380
<p>
395
 
To easily calculate <em class="parameter"><code>end_time</code></em> a combination of <a class="link" href="glib-Date-and-Time-Functions.html#g-get-current-time"><code class="function">g_get_current_time()</code></a>
396
 
and <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-add"><code class="function">g_time_val_add()</code></a> can be used.</p>
 
381
To easily calculate <em class="parameter"><code>end_time</code></em> a combination of <a class="link" href="glib-Date-and-Time-Functions.html#g-get-current-time" title="g_get_current_time ()"><code class="function">g_get_current_time()</code></a>
 
382
and <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-add" title="g_time_val_add ()"><code class="function">g_time_val_add()</code></a> can be used.</p>
397
383
<div class="variablelist"><table border="0">
398
384
<col align="left" valign="top">
399
385
<tbody>
400
386
<tr>
401
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
402
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
403
 
</td>
404
 
</tr>
405
 
<tr>
406
 
<td><p><span class="term"><em class="parameter"><code>end_time</code></em>&#160;:</span></p></td>
407
 
<td> a <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal"><span class="type">GTimeVal</span></a>, determining the final time.
408
 
</td>
409
 
</tr>
410
 
<tr>
411
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
412
 
<td> data from the queue or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, when no data is
 
387
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
388
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
389
</td>
 
390
</tr>
 
391
<tr>
 
392
<td><p><span class="term"><em class="parameter"><code>end_time</code></em> :</span></p></td>
 
393
<td> a <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal"><span class="type">GTimeVal</span></a>, determining the final time.
 
394
</td>
 
395
</tr>
 
396
<tr>
 
397
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
398
<td> data from the queue or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, when no data is
413
399
received before <em class="parameter"><code>end_time</code></em>.
414
400
</td>
415
401
</tr>
418
404
</div>
419
405
<hr>
420
406
<div class="refsect2" lang="en">
421
 
<a name="id2968091"></a><h3>
422
 
<a name="g-async-queue-length"></a>g_async_queue_length ()</h3>
423
 
<a class="indexterm" name="id2968104"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint">gint</a>                g_async_queue_length                (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
407
<a name="g-async-queue-length"></a><h3>g_async_queue_length ()</h3>
 
408
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a>                g_async_queue_length                (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
424
409
<p>
425
410
Returns the length of the queue, negative values mean waiting
426
411
threads, positive values mean available entries in the
433
418
<col align="left" valign="top">
434
419
<tbody>
435
420
<tr>
436
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
437
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
421
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
422
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
438
423
</td>
439
424
</tr>
440
425
<tr>
441
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
426
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
442
427
<td> the length of the <em class="parameter"><code>queue</code></em>.
443
428
</td>
444
429
</tr>
447
432
</div>
448
433
<hr>
449
434
<div class="refsect2" lang="en">
450
 
<a name="id2968188"></a><h3>
451
 
<a name="g-async-queue-sort"></a>g_async_queue_sort ()</h3>
452
 
<a class="indexterm" name="id2968203"></a><pre class="programlisting">void                g_async_queue_sort                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
453
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> func,
454
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
 
435
<a name="g-async-queue-sort"></a><h3>g_async_queue_sort ()</h3>
 
436
<pre class="programlisting">void                g_async_queue_sort                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
437
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> func,
 
438
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
455
439
<p>
456
440
Sorts <em class="parameter"><code>queue</code></em> using <em class="parameter"><code>func</code></em>. 
457
441
</p>
473
457
 return (id1 &gt; id2 ? +1 : id1 == id2 ? 0 : -1);
474
458
</pre></div>
475
459
<p>
476
 
 
477
460
</p>
478
461
<div class="variablelist"><table border="0">
479
462
<col align="left" valign="top">
480
463
<tbody>
481
464
<tr>
482
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
483
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>
 
465
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
466
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>
484
467
</td>
485
468
</tr>
486
469
<tr>
487
 
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
488
 
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc"><span class="type">GCompareDataFunc</span></a> is used to sort <em class="parameter"><code>queue</code></em>. This
 
470
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
 
471
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> is used to sort <em class="parameter"><code>queue</code></em>. This
489
472
    function is passed two elements of the <em class="parameter"><code>queue</code></em>. The function
490
473
    should return 0 if they are equal, a negative value if the
491
474
    first element should be higher in the <em class="parameter"><code>queue</code></em> or a positive
494
477
</td>
495
478
</tr>
496
479
<tr>
497
 
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
 
480
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
498
481
<td> user data passed to <em class="parameter"><code>func</code></em>
499
482
</td>
500
483
</tr>
501
484
</tbody>
502
485
</table></div>
503
 
<p class="since">Since  2.10
504
 
</p>
 
486
<p class="since">Since 2.10</p>
505
487
</div>
506
488
<hr>
507
489
<div class="refsect2" lang="en">
508
 
<a name="id2968391"></a><h3>
509
 
<a name="g-async-queue-lock"></a>g_async_queue_lock ()</h3>
510
 
<a class="indexterm" name="id2968404"></a><pre class="programlisting">void                g_async_queue_lock                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
490
<a name="g-async-queue-lock"></a><h3>g_async_queue_lock ()</h3>
 
491
<pre class="programlisting">void                g_async_queue_lock                  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
511
492
<p>
512
493
Acquires the <em class="parameter"><code>queue</code></em>'s lock. After that you can only call the
513
494
<code class="function">g_async_queue_*<code class="function">_unlocked()</code></code> function variants on that
515
496
<div class="variablelist"><table border="0">
516
497
<col align="left" valign="top">
517
498
<tbody><tr>
518
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
519
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
499
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
500
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
520
501
</td>
521
502
</tr></tbody>
522
503
</table></div>
523
504
</div>
524
505
<hr>
525
506
<div class="refsect2" lang="en">
526
 
<a name="id2968488"></a><h3>
527
 
<a name="g-async-queue-unlock"></a>g_async_queue_unlock ()</h3>
528
 
<a class="indexterm" name="id2968501"></a><pre class="programlisting">void                g_async_queue_unlock                (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
507
<a name="g-async-queue-unlock"></a><h3>g_async_queue_unlock ()</h3>
 
508
<pre class="programlisting">void                g_async_queue_unlock                (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
529
509
<p>
530
510
Releases the queue's lock.</p>
531
511
<div class="variablelist"><table border="0">
532
512
<col align="left" valign="top">
533
513
<tbody><tr>
534
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
535
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
514
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
515
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
536
516
</td>
537
517
</tr></tbody>
538
518
</table></div>
539
519
</div>
540
520
<hr>
541
521
<div class="refsect2" lang="en">
542
 
<a name="id2968557"></a><h3>
543
 
<a name="g-async-queue-ref-unlocked"></a>g_async_queue_ref_unlocked ()</h3>
544
 
<a class="indexterm" name="id2968573"></a><pre class="programlisting">void                g_async_queue_ref_unlocked          (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
522
<a name="g-async-queue-ref-unlocked"></a><h3>g_async_queue_ref_unlocked ()</h3>
 
523
<pre class="programlisting">void                g_async_queue_ref_unlocked          (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
545
524
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
546
525
<h3 class="title">Warning</h3>
547
526
<p><code class="literal">g_async_queue_ref_unlocked</code> is deprecated and should not be used in newly-written code.</p>
551
530
</p>
552
531
<p>
553
532
<em class="parameter"><code>Deprecated</code></em>: Since 2.8, reference counting is done atomically
554
 
so <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-ref"><code class="function">g_async_queue_ref()</code></a> can be used regardless of the <em class="parameter"><code>queue</code></em>'s
 
533
so <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-ref" title="g_async_queue_ref ()"><code class="function">g_async_queue_ref()</code></a> can be used regardless of the <em class="parameter"><code>queue</code></em>'s
555
534
lock.</p>
556
535
<div class="variablelist"><table border="0">
557
536
<col align="left" valign="top">
558
537
<tbody><tr>
559
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
560
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
538
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
539
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
561
540
</td>
562
541
</tr></tbody>
563
542
</table></div>
564
543
</div>
565
544
<hr>
566
545
<div class="refsect2" lang="en">
567
 
<a name="id2968674"></a><h3>
568
 
<a name="g-async-queue-unref-and-unlock"></a>g_async_queue_unref_and_unlock ()</h3>
569
 
<a class="indexterm" name="id2968690"></a><pre class="programlisting">void                g_async_queue_unref_and_unlock      (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
546
<a name="g-async-queue-unref-and-unlock"></a><h3>g_async_queue_unref_and_unlock ()</h3>
 
547
<pre class="programlisting">void                g_async_queue_unref_and_unlock      (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
570
548
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
571
549
<h3 class="title">Warning</h3>
572
550
<p><code class="literal">g_async_queue_unref_and_unlock</code> is deprecated and should not be used in newly-written code.</p>
579
557
</p>
580
558
<p>
581
559
<em class="parameter"><code>Deprecated</code></em>: Since 2.8, reference counting is done atomically
582
 
so <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unref"><code class="function">g_async_queue_unref()</code></a> can be used regardless of the <em class="parameter"><code>queue</code></em>'s
 
560
so <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-unref" title="g_async_queue_unref ()"><code class="function">g_async_queue_unref()</code></a> can be used regardless of the <em class="parameter"><code>queue</code></em>'s
583
561
lock.</p>
584
562
<div class="variablelist"><table border="0">
585
563
<col align="left" valign="top">
586
564
<tbody><tr>
587
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
588
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
565
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
566
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
589
567
</td>
590
568
</tr></tbody>
591
569
</table></div>
592
570
</div>
593
571
<hr>
594
572
<div class="refsect2" lang="en">
595
 
<a name="id2968807"></a><h3>
596
 
<a name="g-async-queue-push-unlocked"></a>g_async_queue_push_unlocked ()</h3>
597
 
<a class="indexterm" name="id2968821"></a><pre class="programlisting">void                g_async_queue_push_unlocked         (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
598
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data);</pre>
 
573
<a name="g-async-queue-push-unlocked"></a><h3>g_async_queue_push_unlocked ()</h3>
 
574
<pre class="programlisting">void                g_async_queue_push_unlocked         (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
575
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data);</pre>
599
576
<p>
600
 
Pushes the <em class="parameter"><code>data</code></em> into the <em class="parameter"><code>queue</code></em>. <em class="parameter"><code>data</code></em> must not be <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. This
 
577
Pushes the <em class="parameter"><code>data</code></em> into the <em class="parameter"><code>queue</code></em>. <em class="parameter"><code>data</code></em> must not be <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>. This
601
578
function must be called while holding the <em class="parameter"><code>queue</code></em>'s lock.</p>
602
579
<div class="variablelist"><table border="0">
603
580
<col align="left" valign="top">
604
581
<tbody>
605
582
<tr>
606
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
607
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
583
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
584
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
608
585
</td>
609
586
</tr>
610
587
<tr>
611
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
 
588
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
612
589
<td> <em class="parameter"><code>data</code></em> to push into the <em class="parameter"><code>queue</code></em>.
613
590
</td>
614
591
</tr>
617
594
</div>
618
595
<hr>
619
596
<div class="refsect2" lang="en">
620
 
<a name="id2968944"></a><h3>
621
 
<a name="g-async-queue-push-sorted-unlocked"></a>g_async_queue_push_sorted_unlocked ()</h3>
622
 
<a class="indexterm" name="id2968961"></a><pre class="programlisting">void                g_async_queue_push_sorted_unlocked  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
623
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> data,
624
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> func,
625
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
 
597
<a name="g-async-queue-push-sorted-unlocked"></a><h3>g_async_queue_push_sorted_unlocked ()</h3>
 
598
<pre class="programlisting">void                g_async_queue_push_sorted_unlocked  (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
599
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> data,
 
600
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> func,
 
601
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
626
602
<p>
627
603
Inserts <em class="parameter"><code>data</code></em> into <em class="parameter"><code>queue</code></em> using <em class="parameter"><code>func</code></em> to determine the new
628
604
position.
635
611
This function is called while holding the <em class="parameter"><code>queue</code></em>'s lock.
636
612
</p>
637
613
<p>
638
 
For an example of <em class="parameter"><code>func</code></em> see <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-sort"><code class="function">g_async_queue_sort()</code></a>.</p>
 
614
For an example of <em class="parameter"><code>func</code></em> see <a class="link" href="glib-Asynchronous-Queues.html#g-async-queue-sort" title="g_async_queue_sort ()"><code class="function">g_async_queue_sort()</code></a>.</p>
639
615
<p>
640
 
 
641
616
</p>
642
617
<div class="variablelist"><table border="0">
643
618
<col align="left" valign="top">
644
619
<tbody>
645
620
<tr>
646
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
647
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>
 
621
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
622
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>
648
623
</td>
649
624
</tr>
650
625
<tr>
651
 
<td><p><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></p></td>
 
626
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
652
627
<td> the <em class="parameter"><code>data</code></em> to push into the <em class="parameter"><code>queue</code></em>
653
628
</td>
654
629
</tr>
655
630
<tr>
656
 
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
657
 
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc"><span class="type">GCompareDataFunc</span></a> is used to sort <em class="parameter"><code>queue</code></em>. This function
 
631
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
 
632
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> is used to sort <em class="parameter"><code>queue</code></em>. This function
658
633
    is passed two elements of the <em class="parameter"><code>queue</code></em>. The function should return
659
634
    0 if they are equal, a negative value if the first element
660
635
    should be higher in the <em class="parameter"><code>queue</code></em> or a positive value if the first
662
637
</td>
663
638
</tr>
664
639
<tr>
665
 
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
 
640
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
666
641
<td> user data passed to <em class="parameter"><code>func</code></em>.
667
642
</td>
668
643
</tr>
669
644
</tbody>
670
645
</table></div>
671
 
<p class="since">Since  2.10
672
 
</p>
 
646
<p class="since">Since 2.10</p>
673
647
</div>
674
648
<hr>
675
649
<div class="refsect2" lang="en">
676
 
<a name="id2969204"></a><h3>
677
 
<a name="g-async-queue-pop-unlocked"></a>g_async_queue_pop_unlocked ()</h3>
678
 
<a class="indexterm" name="id2969218"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_async_queue_pop_unlocked          (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
650
<a name="g-async-queue-pop-unlocked"></a><h3>g_async_queue_pop_unlocked ()</h3>
 
651
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            g_async_queue_pop_unlocked          (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
679
652
<p>
680
653
Pops data from the <em class="parameter"><code>queue</code></em>. This function blocks until data become
681
654
available. This function must be called while holding the <em class="parameter"><code>queue</code></em>'s
684
657
<col align="left" valign="top">
685
658
<tbody>
686
659
<tr>
687
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
688
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
660
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
661
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
689
662
</td>
690
663
</tr>
691
664
<tr>
692
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
665
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
693
666
<td> data from the queue.
694
667
</td>
695
668
</tr>
698
671
</div>
699
672
<hr>
700
673
<div class="refsect2" lang="en">
701
 
<a name="id2969297"></a><h3>
702
 
<a name="g-async-queue-try-pop-unlocked"></a>g_async_queue_try_pop_unlocked ()</h3>
703
 
<a class="indexterm" name="id2969310"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_async_queue_try_pop_unlocked      (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
674
<a name="g-async-queue-try-pop-unlocked"></a><h3>g_async_queue_try_pop_unlocked ()</h3>
 
675
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            g_async_queue_try_pop_unlocked      (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
704
676
<p>
705
 
Tries to pop data from the <em class="parameter"><code>queue</code></em>. If no data is available, <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is
 
677
Tries to pop data from the <em class="parameter"><code>queue</code></em>. If no data is available, <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> is
706
678
returned. This function must be called while holding the <em class="parameter"><code>queue</code></em>'s
707
679
lock.</p>
708
680
<div class="variablelist"><table border="0">
709
681
<col align="left" valign="top">
710
682
<tbody>
711
683
<tr>
712
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
713
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
684
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
685
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
714
686
</td>
715
687
</tr>
716
688
<tr>
717
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
718
 
<td> data from the queue or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, when no data is
 
689
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
690
<td> data from the queue or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, when no data is
719
691
available immediately.
720
692
</td>
721
693
</tr>
724
696
</div>
725
697
<hr>
726
698
<div class="refsect2" lang="en">
727
 
<a name="id2969410"></a><h3>
728
 
<a name="g-async-queue-timed-pop-unlocked"></a>g_async_queue_timed_pop_unlocked ()</h3>
729
 
<a class="indexterm" name="id2969424"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a>            g_async_queue_timed_pop_unlocked    (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
730
 
                                                         <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal">GTimeVal</a> *end_time);</pre>
 
699
<a name="g-async-queue-timed-pop-unlocked"></a><h3>g_async_queue_timed_pop_unlocked ()</h3>
 
700
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a>            g_async_queue_timed_pop_unlocked    (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
701
                                                         <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal">GTimeVal</a> *end_time);</pre>
731
702
<p>
732
703
Pops data from the <em class="parameter"><code>queue</code></em>. If no data is received before <em class="parameter"><code>end_time</code></em>,
733
 
<a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> is returned. This function must be called while holding the
 
704
<a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a> is returned. This function must be called while holding the
734
705
<em class="parameter"><code>queue</code></em>'s lock.
735
706
</p>
736
707
<p>
737
 
To easily calculate <em class="parameter"><code>end_time</code></em> a combination of <a class="link" href="glib-Date-and-Time-Functions.html#g-get-current-time"><code class="function">g_get_current_time()</code></a>
738
 
and <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-add"><code class="function">g_time_val_add()</code></a> can be used.</p>
 
708
To easily calculate <em class="parameter"><code>end_time</code></em> a combination of <a class="link" href="glib-Date-and-Time-Functions.html#g-get-current-time" title="g_get_current_time ()"><code class="function">g_get_current_time()</code></a>
 
709
and <a class="link" href="glib-Date-and-Time-Functions.html#g-time-val-add" title="g_time_val_add ()"><code class="function">g_time_val_add()</code></a> can be used.</p>
739
710
<div class="variablelist"><table border="0">
740
711
<col align="left" valign="top">
741
712
<tbody>
742
713
<tr>
743
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
744
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
745
 
</td>
746
 
</tr>
747
 
<tr>
748
 
<td><p><span class="term"><em class="parameter"><code>end_time</code></em>&#160;:</span></p></td>
749
 
<td> a <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal"><span class="type">GTimeVal</span></a>, determining the final time.
750
 
</td>
751
 
</tr>
752
 
<tr>
753
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
754
 
<td> data from the queue or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, when no data is
 
714
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
715
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
716
</td>
 
717
</tr>
 
718
<tr>
 
719
<td><p><span class="term"><em class="parameter"><code>end_time</code></em> :</span></p></td>
 
720
<td> a <a class="link" href="glib-Date-and-Time-Functions.html#GTimeVal" title="GTimeVal"><span class="type">GTimeVal</span></a>, determining the final time.
 
721
</td>
 
722
</tr>
 
723
<tr>
 
724
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
725
<td> data from the queue or <a class="link" href="glib-Standard-Macros.html#NULL--CAPS" title="NULL"><code class="literal">NULL</code></a>, when no data is
755
726
received before <em class="parameter"><code>end_time</code></em>.
756
727
</td>
757
728
</tr>
760
731
</div>
761
732
<hr>
762
733
<div class="refsect2" lang="en">
763
 
<a name="id2969597"></a><h3>
764
 
<a name="g-async-queue-length-unlocked"></a>g_async_queue_length_unlocked ()</h3>
765
 
<a class="indexterm" name="id2969611"></a><pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint">gint</a>                g_async_queue_length_unlocked       (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue);</pre>
 
734
<a name="g-async-queue-length-unlocked"></a><h3>g_async_queue_length_unlocked ()</h3>
 
735
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint">gint</a>                g_async_queue_length_unlocked       (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue);</pre>
766
736
<p>
767
737
Returns the length of the queue, negative values mean waiting
768
738
threads, positive values mean available entries in the
776
746
<col align="left" valign="top">
777
747
<tbody>
778
748
<tr>
779
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
780
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
 
749
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
750
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>.
781
751
</td>
782
752
</tr>
783
753
<tr>
784
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></p></td>
 
754
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
785
755
<td> the length of the <em class="parameter"><code>queue</code></em>.
786
756
</td>
787
757
</tr>
790
760
</div>
791
761
<hr>
792
762
<div class="refsect2" lang="en">
793
 
<a name="id2969706"></a><h3>
794
 
<a name="g-async-queue-sort-unlocked"></a>g_async_queue_sort_unlocked ()</h3>
795
 
<a class="indexterm" name="id2969723"></a><pre class="programlisting">void                g_async_queue_sort_unlocked         (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue">GAsyncQueue</a> *queue,
796
 
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc">GCompareDataFunc</a> func,
797
 
                                                         <a class="link" href="glib-Basic-Types.html#gpointer">gpointer</a> user_data);</pre>
 
763
<a name="g-async-queue-sort-unlocked"></a><h3>g_async_queue_sort_unlocked ()</h3>
 
764
<pre class="programlisting">void                g_async_queue_sort_unlocked         (<a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue">GAsyncQueue</a> *queue,
 
765
                                                         <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()">GCompareDataFunc</a> func,
 
766
                                                         <a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer">gpointer</a> user_data);</pre>
798
767
<p>
799
768
Sorts <em class="parameter"><code>queue</code></em> using <em class="parameter"><code>func</code></em>. 
800
769
</p>
801
770
<p>
802
771
This function is called while holding the <em class="parameter"><code>queue</code></em>'s lock.</p>
803
772
<p>
804
 
 
805
773
</p>
806
774
<div class="variablelist"><table border="0">
807
775
<col align="left" valign="top">
808
776
<tbody>
809
777
<tr>
810
 
<td><p><span class="term"><em class="parameter"><code>queue</code></em>&#160;:</span></p></td>
811
 
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue"><span class="type">GAsyncQueue</span></a>
 
778
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
 
779
<td> a <a class="link" href="glib-Asynchronous-Queues.html#GAsyncQueue" title="GAsyncQueue"><span class="type">GAsyncQueue</span></a>
812
780
</td>
813
781
</tr>
814
782
<tr>
815
 
<td><p><span class="term"><em class="parameter"><code>func</code></em>&#160;:</span></p></td>
816
 
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc"><span class="type">GCompareDataFunc</span></a> is used to sort <em class="parameter"><code>queue</code></em>. This
 
783
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
 
784
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> is used to sort <em class="parameter"><code>queue</code></em>. This
817
785
    function is passed two elements of the <em class="parameter"><code>queue</code></em>. The function
818
786
    should return 0 if they are equal, a negative value if the
819
787
    first element should be higher in the <em class="parameter"><code>queue</code></em> or a positive
822
790
</td>
823
791
</tr>
824
792
<tr>
825
 
<td><p><span class="term"><em class="parameter"><code>user_data</code></em>&#160;:</span></p></td>
 
793
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
826
794
<td> user data passed to <em class="parameter"><code>func</code></em>
827
795
</td>
828
796
</tr>
829
797
</tbody>
830
798
</table></div>
831
 
<p class="since">Since  2.10
832
 
</p>
833
 
</div>
834
 
</div>
835
 
<div class="refsect1" lang="en">
836
 
<a name="id2969896"></a><div class="refsect2" lang="en"><a name="id2969897"></a></div>
 
799
<p class="since">Since 2.10</p>
 
800
</div>
 
801
</div>
 
802
</div>
 
803
<div class="footer">
837
804
<hr>
838
 
<div class="refsect2" lang="en"><a name="id2969898"></a></div>
839
 
</div>
840
 
</div>
 
805
          Generated by GTK-Doc V1.11</div>
841
806
</body>
842
807
</html>