34
34
<a href="classGlib_1_1Thread-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
36
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
37
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Thread_1_1Exit.html">Exit</a></td></tr>
39
<tr><td class="mdescLeft"> </td><td class="mdescRight">Exception class used to exit from a thread. <a href="classGlib_1_1Thread_1_1Exit.html#_details">More...</a><br></td></tr>
36
40
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
37
41
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Thread.html#9feee4b860d9928f86b9d255e2f2b133">joinable</a> () const </td></tr>
67
71
<tr><td colspan="2">(Note that these are not member functions.) <br><br></td></tr>
68
72
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classGlib_1_1Thread.html">Thread</a>* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__Threads.html#g6bfbb3119eaac9fa8cb725aa1e82f61e">wrap</a> (GThread* gobject)</td></tr>
70
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
71
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1Thread_1_1Exit.html">Exit</a></td></tr>
73
<tr><td class="mdescLeft"> </td><td class="mdescRight">Exception class used to exit from a thread. <a href="classGlib_1_1Thread_1_1Exit.html#_details">More...</a><br></td></tr>
75
75
<hr><a name="_details"></a><h2>Detailed Description</h2>
76
76
Represents a running thread.
84
84
<a class="el" href="thread_2dispatcher_8cc-example.html#_a0">thread/dispatcher.cc</a>, and <a class="el" href="thread_2thread_8cc-example.html#_a11">thread/thread.cc</a>.</dl><hr><h2>Member Function Documentation</h2>
85
<a class="anchor" name="b165854ff2fc9b454ee4d97050485782"></a><!-- doxytag: member="Glib::Thread::create" ref="b165854ff2fc9b454ee4d97050485782" args="(const sigc::slot< void > &slot, bool joinable)" -->
87
<div class="memproto">
88
<table class="memname">
90
<td class="memname">static <a class="el" href="classGlib_1_1Thread.html">Thread</a>* Glib::Thread::create </td>
92
<td class="paramtype">const sigc::slot< void > & </td>
93
<td class="paramname"> <em>slot</em>, </td>
96
<td class="paramkey"></td>
98
<td class="paramtype">bool </td>
99
<td class="paramname"> <em>joinable</em></td><td> </td>
104
<td></td><td></td><td><code> [static]</code></td>
111
Creates a new thread with the priority <code>THREAD_PRIORITY_NORMAL</code>.
113
If <em>joinable</em> is <code>true</code>, you can wait for this thread's termination by calling <a class="el" href="classGlib_1_1Thread.html#b95e51699279fd84c9577c45d76b0d8e" title="Waits until the thread finishes.">join()</a>. Otherwise the thread will just disappear, when ready.<p>
114
The new thread executes the function or method <em>slot</em> points to. You can pass additional arguments using sigc::bind(). If the thread was created successfully, it is returned, otherwise a <a class="el" href="classGlib_1_1ThreadError.html" title="Exception class for thread-related errors.">ThreadError</a> exception is thrown.<p>
115
Because <a class="el" href="classsigc_1_1trackable.html">sigc::trackable</a> is not thread safe, if the slot represents a non-static class method (that is, it is created by <a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__8__memadaptors.html#ga2">sigc::mem_fun()</a>), the class concerned should not derive from <a class="el" href="classsigc_1_1trackable.html">sigc::trackable</a>.<p>
116
<dl compact><dt><b>Parameters:</b></dt><dd>
117
<table border="0" cellspacing="2" cellpadding="0">
118
<tr><td valign="top"></td><td valign="top"><em>slot</em> </td><td>A slot to execute in the new thread. </td></tr>
119
<tr><td valign="top"></td><td valign="top"><em>joinable</em> </td><td>Should this thread be joinable? </td></tr>
122
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The new Thread* on success. </dd></dl>
123
<dl compact><dt><b>Exceptions:</b></dt><dd>
124
<table border="0" cellspacing="2" cellpadding="0">
125
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classGlib_1_1ThreadError.html" title="Exception class for thread-related errors.">Glib::ThreadError</a></em> </td><td></td></tr>
128
<dl compact><dt><b>Examples: </b></dt><dd>
129
<a class="el" href="thread_2dispatcher_8cc-example.html#a6">thread/dispatcher.cc</a>, and <a class="el" href="thread_2thread_8cc-example.html#a12">thread/thread.cc</a>.</dl>
132
85
<a class="anchor" name="f30a7a8b037c7c7a3802aa2a22cf612d"></a><!-- doxytag: member="Glib::Thread::create" ref="f30a7a8b037c7c7a3802aa2a22cf612d" args="(const sigc::slot< void > &slot, unsigned long stack_size, bool joinable, bool bound, ThreadPriority priority)" -->
133
86
<div class="memitem">
134
87
<div class="memproto">
202
<a class="anchor" name="9db6864c35701b1c179f48217ab76cca"></a><!-- doxytag: member="Glib::Thread::self" ref="9db6864c35701b1c179f48217ab76cca" args="()" -->
155
<a class="anchor" name="b165854ff2fc9b454ee4d97050485782"></a><!-- doxytag: member="Glib::Thread::create" ref="b165854ff2fc9b454ee4d97050485782" args="(const sigc::slot< void > &slot, bool joinable)" -->
203
156
<div class="memitem">
204
157
<div class="memproto">
205
158
<table class="memname">
207
<td class="memname">static <a class="el" href="classGlib_1_1Thread.html">Thread</a>* Glib::Thread::self </td>
160
<td class="memname">static <a class="el" href="classGlib_1_1Thread.html">Thread</a>* Glib::Thread::create </td>
209
<td class="paramname"> </td>
210
<td> ) </td>
211
<td><code> [static]</code></td>
162
<td class="paramtype">const sigc::slot< void > & </td>
163
<td class="paramname"> <em>slot</em>, </td>
166
<td class="paramkey"></td>
168
<td class="paramtype">bool </td>
169
<td class="paramname"> <em>joinable</em></td><td> </td>
174
<td></td><td></td><td><code> [static]</code></td>
215
178
<div class="memdoc">
218
Returns the Thread* corresponding to the calling thread.
181
Creates a new thread with the priority <code>THREAD_PRIORITY_NORMAL</code>.
220
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The current thread. </dd></dl>
183
If <em>joinable</em> is <code>true</code>, you can wait for this thread's termination by calling <a class="el" href="classGlib_1_1Thread.html#b95e51699279fd84c9577c45d76b0d8e" title="Waits until the thread finishes.">join()</a>. Otherwise the thread will just disappear, when ready.<p>
184
The new thread executes the function or method <em>slot</em> points to. You can pass additional arguments using sigc::bind(). If the thread was created successfully, it is returned, otherwise a <a class="el" href="classGlib_1_1ThreadError.html" title="Exception class for thread-related errors.">ThreadError</a> exception is thrown.<p>
185
Because <a class="el" href="classsigc_1_1trackable.html">sigc::trackable</a> is not thread safe, if the slot represents a non-static class method (that is, it is created by <a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__8__memadaptors.html#ga2">sigc::mem_fun()</a>), the class concerned should not derive from <a class="el" href="classsigc_1_1trackable.html">sigc::trackable</a>.<p>
186
<dl compact><dt><b>Parameters:</b></dt><dd>
187
<table border="0" cellspacing="2" cellpadding="0">
188
<tr><td valign="top"></td><td valign="top"><em>slot</em> </td><td>A slot to execute in the new thread. </td></tr>
189
<tr><td valign="top"></td><td valign="top"><em>joinable</em> </td><td>Should this thread be joinable? </td></tr>
192
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The new Thread* on success. </dd></dl>
193
<dl compact><dt><b>Exceptions:</b></dt><dd>
194
<table border="0" cellspacing="2" cellpadding="0">
195
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="classGlib_1_1ThreadError.html" title="Exception class for thread-related errors.">Glib::ThreadError</a></em> </td><td></td></tr>
198
<dl compact><dt><b>Examples: </b></dt><dd>
199
<a class="el" href="thread_2dispatcher_8cc-example.html#a6">thread/dispatcher.cc</a>, and <a class="el" href="thread_2thread_8cc-example.html#a12">thread/thread.cc</a>.</dl>
224
<a class="anchor" name="9feee4b860d9928f86b9d255e2f2b133"></a><!-- doxytag: member="Glib::Thread::joinable" ref="9feee4b860d9928f86b9d255e2f2b133" args="() const " -->
202
<a class="anchor" name="28d1bcf53d846b8b0d75b93178a614ab"></a><!-- doxytag: member="Glib::Thread::get_priority" ref="28d1bcf53d846b8b0d75b93178a614ab" args="() const " -->
225
203
<div class="memitem">
226
204
<div class="memproto">
227
205
<table class="memname">
229
<td class="memname">bool Glib::Thread::joinable </td>
207
<td class="memname"><a class="el" href="group__glibmmEnums.html#g9b87dca6496b6ad53baec9ca01318448">ThreadPriority</a> Glib::Thread::get_priority </td>
231
209
<td class="paramname"> </td>
232
210
<td> ) </td>
237
215
<div class="memdoc">
240
Returns whether the thread is joinable.
242
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Whether the thread is joinable. </dd></dl>
218
Returns the priority of the thread.
220
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The thread's priority. </dd></dl>
224
<a class="anchor" name="351fa5fb621a394e28037c4f50ab69ad"></a><!-- doxytag: member="Glib::Thread::gobj" ref="351fa5fb621a394e28037c4f50ab69ad" args="() const " -->
225
<div class="memitem">
226
<div class="memproto">
227
<table class="memname">
229
<td class="memname">const GThread* Glib::Thread::gobj </td>
231
<td class="paramname"> </td>
232
<td> ) </td>
233
<td> const<code> [inline]</code></td>
243
<a class="anchor" name="28fbc6c46928a90d82114fa9b6b63196"></a><!-- doxytag: member="Glib::Thread::gobj" ref="28fbc6c46928a90d82114fa9b6b63196" args="()" -->
244
<div class="memitem">
245
<div class="memproto">
246
<table class="memname">
248
<td class="memname">GThread* Glib::Thread::gobj </td>
250
<td class="paramname"> </td>
251
<td> ) </td>
252
<td><code> [inline]</code></td>
265
281
<a class="el" href="thread_2thread_8cc-example.html#a14">thread/thread.cc</a>.</dl>
284
<a class="anchor" name="9feee4b860d9928f86b9d255e2f2b133"></a><!-- doxytag: member="Glib::Thread::joinable" ref="9feee4b860d9928f86b9d255e2f2b133" args="() const " -->
285
<div class="memitem">
286
<div class="memproto">
287
<table class="memname">
289
<td class="memname">bool Glib::Thread::joinable </td>
291
<td class="paramname"> </td>
292
<td> ) </td>
300
Returns whether the thread is joinable.
302
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Whether the thread is joinable. </dd></dl>
306
<a class="anchor" name="9db6864c35701b1c179f48217ab76cca"></a><!-- doxytag: member="Glib::Thread::self" ref="9db6864c35701b1c179f48217ab76cca" args="()" -->
307
<div class="memitem">
308
<div class="memproto">
309
<table class="memname">
311
<td class="memname">static <a class="el" href="classGlib_1_1Thread.html">Thread</a>* Glib::Thread::self </td>
313
<td class="paramname"> </td>
314
<td> ) </td>
315
<td><code> [static]</code></td>
322
Returns the Thread* corresponding to the calling thread.
324
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The current thread. </dd></dl>
268
328
<a class="anchor" name="3b323f981147d7eb4b4bd03f3fbdccf5"></a><!-- doxytag: member="Glib::Thread::set_priority" ref="3b323f981147d7eb4b4bd03f3fbdccf5" args="(ThreadPriority priority)" -->
269
329
<div class="memitem">
270
330
<div class="memproto">
296
<a class="anchor" name="28d1bcf53d846b8b0d75b93178a614ab"></a><!-- doxytag: member="Glib::Thread::get_priority" ref="28d1bcf53d846b8b0d75b93178a614ab" args="() const " -->
297
<div class="memitem">
298
<div class="memproto">
299
<table class="memname">
301
<td class="memname"><a class="el" href="group__glibmmEnums.html#g9b87dca6496b6ad53baec9ca01318448">ThreadPriority</a> Glib::Thread::get_priority </td>
303
<td class="paramname"> </td>
304
<td> ) </td>
312
Returns the priority of the thread.
314
<dl class="return" compact><dt><b>Returns:</b></dt><dd>The thread's priority. </dd></dl>
318
356
<a class="anchor" name="cad8be7a8093ef3aca32344264461011"></a><!-- doxytag: member="Glib::Thread::yield" ref="cad8be7a8093ef3aca32344264461011" args="()" -->
319
357
<div class="memitem">
320
358
<div class="memproto">
336
374
This function is often used as a method to make busy wait less evil. But in most cases, you will encounter, there are better methods to do that. So in general you shouldn't use this function.
339
<a class="anchor" name="28fbc6c46928a90d82114fa9b6b63196"></a><!-- doxytag: member="Glib::Thread::gobj" ref="28fbc6c46928a90d82114fa9b6b63196" args="()" -->
340
<div class="memitem">
341
<div class="memproto">
342
<table class="memname">
344
<td class="memname">GThread* Glib::Thread::gobj </td>
346
<td class="paramname"> </td>
347
<td> ) </td>
348
<td><code> [inline]</code></td>
358
<a class="anchor" name="351fa5fb621a394e28037c4f50ab69ad"></a><!-- doxytag: member="Glib::Thread::gobj" ref="351fa5fb621a394e28037c4f50ab69ad" args="() const " -->
359
<div class="memitem">
360
<div class="memproto">
361
<table class="memname">
363
<td class="memname">const GThread* Glib::Thread::gobj </td>
365
<td class="paramname"> </td>
366
<td> ) </td>
367
<td> const<code> [inline]</code></td>
377
377
<hr>The documentation for this class was generated from the following file:<ul>
378
378
<li><a class="el" href="thread_8h.html">thread.h</a></ul>