| Current File : //usr/share/doc/dbus/api/group__DBusThreads.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>D-Bus: Thread functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">D-Bus
 <span id="projectnumber">1.8.20</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Thread functions</div> </div>
<div class="ingroups"><a class="el" href="group__DBus.html">D-Bus low-level public API</a></div></div><!--header-->
<div class="contents">
<p><a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a> and <a class="el" href="group__DBusThreads.html#ga33b6cf3b8f1e41bad5508f84758818a7" title="Initializes threads.">dbus_threads_init_default()</a>
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structDBusThreadFunctions.html">DBusThreadFunctions</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Functions that must be implemented to make the D-Bus library thread-aware. <a href="structDBusThreadFunctions.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">An opaque mutex type provided by the <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a> implementation installed by <a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a>. <a href="#ga4eb021cd6cd0830423eac2738e0ddc40"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structDBusCondVar.html">DBusCondVar</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#gaa14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">An opaque condition variable type provided by the <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a> implementation installed by <a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a>. <a href="#gaa14cd16a336a85b5edbca3c237c3829e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#gae4cd138019719921ee81d7f3af2f0299">DBusMutexNewFunction</a> )(void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated, provide DBusRecursiveMutexNewFunction instead. <a href="#gae4cd138019719921ee81d7f3af2f0299"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga571a95a8897fdf1cc80f36710f95efe7">DBusMutexFreeFunction</a> )(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated, provide DBusRecursiveMutexFreeFunction instead. <a href="#ga571a95a8897fdf1cc80f36710f95efe7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga5ff3bc4d16295140d831c5f1a52f74aa">DBusMutexLockFunction</a> )(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated, provide DBusRecursiveMutexLockFunction instead. <a href="#ga5ff3bc4d16295140d831c5f1a52f74aa"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga5568e0cd30e1872705d582e27c22e57f">DBusMutexUnlockFunction</a> )(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Deprecated, provide DBusRecursiveMutexUnlockFunction instead. <a href="#ga5568e0cd30e1872705d582e27c22e57f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga08fc7d346a564450730cc52035959681">DBusRecursiveMutexNewFunction</a> )(void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a new recursively-lockable mutex, or returns <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if not enough memory. <a href="#ga08fc7d346a564450730cc52035959681"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga1709b60b7643b272a1c06a4270213a91">DBusRecursiveMutexFreeFunction</a> )(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees a recursively-lockable mutex. <a href="#ga1709b60b7643b272a1c06a4270213a91"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga08e197c1f992c7b91fe5541e4e36394c">DBusRecursiveMutexLockFunction</a> )(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Locks a recursively-lockable mutex. <a href="#ga08e197c1f992c7b91fe5541e4e36394c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#gae12cbb69548ed6211a382962bcef12bf">DBusRecursiveMutexUnlockFunction</a> )(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Unlocks a recursively-lockable mutex. <a href="#gae12cbb69548ed6211a382962bcef12bf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="structDBusCondVar.html">DBusCondVar</a> *(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga8187aee4a3803e6b3859bf0054b32004">DBusCondVarNewFunction</a> )(void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a new condition variable. <a href="#ga8187aee4a3803e6b3859bf0054b32004"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#gae65cc291c8c22bc2db83d6b72e41406c">DBusCondVarFreeFunction</a> )(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees a condition variable. <a href="#gae65cc291c8c22bc2db83d6b72e41406c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#gac27ac55dc1ef5cd28d14ab6edf9e02fb">DBusCondVarWaitFunction</a> )(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond, <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Waits on a condition variable. <a href="#gac27ac55dc1ef5cd28d14ab6edf9e02fb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga33c3b5d908d32e6262c8c5dc269e1f8b">DBusCondVarWaitTimeoutFunction</a> )(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond, <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex, int timeout_milliseconds)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Waits on a condition variable with a timeout. <a href="#ga33c3b5d908d32e6262c8c5dc269e1f8b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga1035883699fd580d9eeeaf8355dfd733">DBusCondVarWakeOneFunction</a> )(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wakes one waiting thread on a condition variable. <a href="#ga1035883699fd580d9eeeaf8355dfd733"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga28d3cc22cb2374ae0e1c56df41632853">DBusCondVarWakeAllFunction</a> )(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Wakes all waiting threads on a condition variable. <a href="#ga28d3cc22cb2374ae0e1c56df41632853"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#gaf6212cb5e78b84cf5c6c6cb6e2b5aabe">DBusThreadFunctionsMask</a> { <br/>
  <b>DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK</b> = 1 << 0,
<b>DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK</b> = 1 << 1,
<b>DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK</b> = 1 << 2,
<b>DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK</b> = 1 << 3,
<br/>
  <b>DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK</b> = 1 << 4,
<b>DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK</b> = 1 << 5,
<b>DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK</b> = 1 << 6,
<b>DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK</b> = 1 << 7,
<br/>
  <b>DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK</b> = 1 << 8,
<b>DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK</b> = 1 << 9,
<b>DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK</b> = 1 << 10,
<b>DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK</b> = 1 << 11,
<br/>
  <b>DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK</b> = 1 << 12,
<b>DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK</b> = 1 << 13,
<b>DBUS_THREAD_FUNCTIONS_ALL_MASK</b> = (1 << 14) - 1
<br/>
}</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Flags indicating which functions are present in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. <a href="group__DBusThreads.html#gaf6212cb5e78b84cf5c6c6cb6e2b5aabe">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc">dbus_threads_init</a> (const <a class="el" href="structDBusThreadFunctions.html">DBusThreadFunctions</a> *functions)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initializes threads, like <a class="el" href="group__DBusThreads.html#ga33b6cf3b8f1e41bad5508f84758818a7" title="Initializes threads.">dbus_threads_init_default()</a>. <a href="#gac7b8a7001befc3eaa8c6b043151008dc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreads.html#ga33b6cf3b8f1e41bad5508f84758818a7">dbus_threads_init_default</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initializes threads. <a href="#ga33b6cf3b8f1e41bad5508f84758818a7"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p><a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a> and <a class="el" href="group__DBusThreads.html#ga33b6cf3b8f1e41bad5508f84758818a7" title="Initializes threads.">dbus_threads_init_default()</a> </p>
<p>Functions and macros related to threads and thread locks.</p>
<p>If threads are initialized, the D-Bus library has locks on all global data structures. In addition, each <a class="el" href="structDBusConnection.html" title="Implementation details of DBusConnection.">DBusConnection</a> has a lock, so only one thread at a time can touch the connection. (See <a class="el" href="group__DBusConnection.html">DBusConnection</a> for more on connection locking.)</p>
<p>Most other objects, however, do not have locks - they can only be used from a single thread at a time, unless you lock them yourself. For example, a <a class="el" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> can't be modified from two threads at once. </p>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="gaa14cd16a336a85b5edbca3c237c3829e"></a><!-- doxytag: member="dbus-threads.h::DBusCondVar" ref="gaa14cd16a336a85b5edbca3c237c3829e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="structDBusCondVar.html">DBusCondVar</a> <a class="el" href="structDBusCondVar.html">DBusCondVar</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>An opaque condition variable type provided by the <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a> implementation installed by <a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a>. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00043">43</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="gae65cc291c8c22bc2db83d6b72e41406c"></a><!-- doxytag: member="dbus-threads.h::DBusCondVarFreeFunction" ref="gae65cc291c8c22bc2db83d6b72e41406c" args=")(DBusCondVar *cond)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__DBusThreads.html#gae65cc291c8c22bc2db83d6b72e41406c">DBusCondVarFreeFunction</a>)(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Frees a condition variable. </p>
<p>Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00080">80</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga8187aee4a3803e6b3859bf0054b32004"></a><!-- doxytag: member="dbus-threads.h::DBusCondVarNewFunction" ref="ga8187aee4a3803e6b3859bf0054b32004" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="structDBusCondVar.html">DBusCondVar</a>*(* <a class="el" href="group__DBusThreads.html#ga8187aee4a3803e6b3859bf0054b32004">DBusCondVarNewFunction</a>)(void)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a new condition variable. </p>
<p>Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. Can only fail (returning <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>) due to lack of memory. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00077">77</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="gac27ac55dc1ef5cd28d14ab6edf9e02fb"></a><!-- doxytag: member="dbus-threads.h::DBusCondVarWaitFunction" ref="gac27ac55dc1ef5cd28d14ab6edf9e02fb" args=")(DBusCondVar *cond, DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__DBusThreads.html#gac27ac55dc1ef5cd28d14ab6edf9e02fb">DBusCondVarWaitFunction</a>)(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond, <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits on a condition variable. </p>
<p>Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. Must work with either a recursive or nonrecursive mutex, whichever the thread implementation provides. Note that PTHREAD_MUTEX_RECURSIVE does not work with condition variables (does not save/restore the recursion count) so don't try using simply pthread_cond_wait() and a PTHREAD_MUTEX_RECURSIVE to implement this, it won't work right.</p>
<p>Has no error conditions. Must succeed if it returns. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00092">92</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga33c3b5d908d32e6262c8c5dc269e1f8b"></a><!-- doxytag: member="dbus-threads.h::DBusCondVarWaitTimeoutFunction" ref="ga33c3b5d908d32e6262c8c5dc269e1f8b" args=")(DBusCondVar *cond, DBusMutex *mutex, int timeout_milliseconds)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>(* <a class="el" href="group__DBusThreads.html#ga33c3b5d908d32e6262c8c5dc269e1f8b">DBusCondVarWaitTimeoutFunction</a>)(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond, <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex, int timeout_milliseconds)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Waits on a condition variable with a timeout. </p>
<p>Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. Returns <a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a> if the wait did not time out, and <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a> if it did.</p>
<p>Has no error conditions. Must succeed if it returns. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00101">101</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga28d3cc22cb2374ae0e1c56df41632853"></a><!-- doxytag: member="dbus-threads.h::DBusCondVarWakeAllFunction" ref="ga28d3cc22cb2374ae0e1c56df41632853" args=")(DBusCondVar *cond)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__DBusThreads.html#ga28d3cc22cb2374ae0e1c56df41632853">DBusCondVarWakeAllFunction</a>)(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wakes all waiting threads on a condition variable. </p>
<p>Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>.</p>
<p>Has no error conditions. Must succeed if it returns. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00114">114</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga1035883699fd580d9eeeaf8355dfd733"></a><!-- doxytag: member="dbus-threads.h::DBusCondVarWakeOneFunction" ref="ga1035883699fd580d9eeeaf8355dfd733" args=")(DBusCondVar *cond)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__DBusThreads.html#ga1035883699fd580d9eeeaf8355dfd733">DBusCondVarWakeOneFunction</a>)(<a class="el" href="structDBusCondVar.html">DBusCondVar</a> *cond)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Wakes one waiting thread on a condition variable. </p>
<p>Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>.</p>
<p>Has no error conditions. Must succeed if it returns. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00108">108</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga4eb021cd6cd0830423eac2738e0ddc40"></a><!-- doxytag: member="dbus-threads.h::DBusMutex" ref="ga4eb021cd6cd0830423eac2738e0ddc40" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>An opaque mutex type provided by the <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a> implementation installed by <a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a>. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00041">41</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga571a95a8897fdf1cc80f36710f95efe7"></a><!-- doxytag: member="dbus-threads.h::DBusMutexFreeFunction" ref="ga571a95a8897fdf1cc80f36710f95efe7" args=")(DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__DBusThreads.html#ga571a95a8897fdf1cc80f36710f95efe7">DBusMutexFreeFunction</a>)(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deprecated, provide DBusRecursiveMutexFreeFunction instead. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00048">48</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga5ff3bc4d16295140d831c5f1a52f74aa"></a><!-- doxytag: member="dbus-threads.h::DBusMutexLockFunction" ref="ga5ff3bc4d16295140d831c5f1a52f74aa" args=")(DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>(* <a class="el" href="group__DBusThreads.html#ga5ff3bc4d16295140d831c5f1a52f74aa">DBusMutexLockFunction</a>)(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deprecated, provide DBusRecursiveMutexLockFunction instead. </p>
<p>Return value is lock success, but gets ignored in practice. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00050">50</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="gae4cd138019719921ee81d7f3af2f0299"></a><!-- doxytag: member="dbus-threads.h::DBusMutexNewFunction" ref="gae4cd138019719921ee81d7f3af2f0299" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a>*(* <a class="el" href="group__DBusThreads.html#gae4cd138019719921ee81d7f3af2f0299">DBusMutexNewFunction</a>)(void)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deprecated, provide DBusRecursiveMutexNewFunction instead. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00046">46</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga5568e0cd30e1872705d582e27c22e57f"></a><!-- doxytag: member="dbus-threads.h::DBusMutexUnlockFunction" ref="ga5568e0cd30e1872705d582e27c22e57f" args=")(DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a>(* <a class="el" href="group__DBusThreads.html#ga5568e0cd30e1872705d582e27c22e57f">DBusMutexUnlockFunction</a>)(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Deprecated, provide DBusRecursiveMutexUnlockFunction instead. </p>
<p>Return value is unlock success, but gets ignored in practice. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00052">52</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga1709b60b7643b272a1c06a4270213a91"></a><!-- doxytag: member="dbus-threads.h::DBusRecursiveMutexFreeFunction" ref="ga1709b60b7643b272a1c06a4270213a91" args=")(DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__DBusThreads.html#ga1709b60b7643b272a1c06a4270213a91">DBusRecursiveMutexFreeFunction</a>)(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Frees a recursively-lockable mutex. </p>
<p>Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00064">64</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga08e197c1f992c7b91fe5541e4e36394c"></a><!-- doxytag: member="dbus-threads.h::DBusRecursiveMutexLockFunction" ref="ga08e197c1f992c7b91fe5541e4e36394c" args=")(DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__DBusThreads.html#ga08e197c1f992c7b91fe5541e4e36394c">DBusRecursiveMutexLockFunction</a>)(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Locks a recursively-lockable mutex. </p>
<p>Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. Can only fail due to lack of memory. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00068">68</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="ga08fc7d346a564450730cc52035959681"></a><!-- doxytag: member="dbus-threads.h::DBusRecursiveMutexNewFunction" ref="ga08fc7d346a564450730cc52035959681" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a>*(* <a class="el" href="group__DBusThreads.html#ga08fc7d346a564450730cc52035959681">DBusRecursiveMutexNewFunction</a>)(void)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a new recursively-lockable mutex, or returns <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a> if not enough memory. </p>
<p>Can only fail due to lack of memory. Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. Do not just use PTHREAD_MUTEX_RECURSIVE for this, because it does not save/restore the recursion count when waiting on a condition. libdbus requires the Java-style behavior where the mutex is fully unlocked to wait on a condition. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00061">61</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<a class="anchor" id="gae12cbb69548ed6211a382962bcef12bf"></a><!-- doxytag: member="dbus-threads.h::DBusRecursiveMutexUnlockFunction" ref="gae12cbb69548ed6211a382962bcef12bf" args=")(DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void(* <a class="el" href="group__DBusThreads.html#gae12cbb69548ed6211a382962bcef12bf">DBusRecursiveMutexUnlockFunction</a>)(<a class="el" href="group__DBusThreads.html#ga4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Unlocks a recursively-lockable mutex. </p>
<p>Found in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. Can only fail due to lack of memory. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00072">72</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="gaf6212cb5e78b84cf5c6c6cb6e2b5aabe"></a><!-- doxytag: member="dbus-threads.h::DBusThreadFunctionsMask" ref="gaf6212cb5e78b84cf5c6c6cb6e2b5aabe" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__DBusThreads.html#gaf6212cb5e78b84cf5c6c6cb6e2b5aabe">DBusThreadFunctionsMask</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Flags indicating which functions are present in <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. </p>
<p>Used to allow the library to detect older callers of <a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc" title="Initializes threads, like dbus_threads_init_default().">dbus_threads_init()</a> if new possible functions are added to <a class="el" href="structDBusThreadFunctions.html" title="Functions that must be implemented to make the D-Bus library thread-aware.">DBusThreadFunctions</a>. </p>
<p>Definition at line <a class="el" href="dbus-threads_8h_source.html#l00121">121</a> of file <a class="el" href="dbus-threads_8h_source.html">dbus-threads.h</a>.</p>
</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gac7b8a7001befc3eaa8c6b043151008dc"></a><!-- doxytag: member="dbus-threads.c::dbus_threads_init" ref="gac7b8a7001befc3eaa8c6b043151008dc" args="(const DBusThreadFunctions *functions)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusThreads.html#gac7b8a7001befc3eaa8c6b043151008dc">dbus_threads_init</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="structDBusThreadFunctions.html">DBusThreadFunctions</a> * </td>
<td class="paramname"><em>functions</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes threads, like <a class="el" href="group__DBusThreads.html#ga33b6cf3b8f1e41bad5508f84758818a7" title="Initializes threads.">dbus_threads_init_default()</a>. </p>
<p>This version previously allowed user-specified threading primitives, but since D-Bus 1.6 it ignores them and behaves exactly like <a class="el" href="group__DBusThreads.html#ga33b6cf3b8f1e41bad5508f84758818a7" title="Initializes threads.">dbus_threads_init_default()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramname">functions</td><td>ignored, formerly functions for using threads </td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a> on success, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a> if no memory </dd></dl>
<p>Definition at line <a class="el" href="dbus-threads_8c_source.html#l00391">391</a> of file <a class="el" href="dbus-threads_8c_source.html">dbus-threads.c</a>.</p>
<p>References <a class="el" href="dbus-memory_8c_source.html#l00781">_dbus_current_generation</a>, <a class="el" href="dbus-sysdeps-pthread_8c_source.html#l00278">_dbus_threads_init_platform_specific()</a>, <a class="el" href="dbus-sysdeps-pthread_8c_source.html#l00292">_dbus_threads_lock_platform_specific()</a>, <a class="el" href="dbus-sysdeps-pthread_8c_source.html#l00298">_dbus_threads_unlock_platform_specific()</a>, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1">FALSE</a>, and <a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>.</p>
<p>Referenced by <a class="el" href="dbus-threads_8c_source.html#l00438">dbus_threads_init_default()</a>.</p>
</div>
</div>
<a class="anchor" id="ga33b6cf3b8f1e41bad5508f84758818a7"></a><!-- doxytag: member="dbus-threads.c::dbus_threads_init_default" ref="ga33b6cf3b8f1e41bad5508f84758818a7" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">DBUS_EXPORT <a class="el" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> <a class="el" href="group__DBusThreads.html#ga33b6cf3b8f1e41bad5508f84758818a7">dbus_threads_init_default</a> </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Initializes threads. </p>
<p>If this function is not called, the D-Bus library will not lock any data structures. If it is called, D-Bus will do locking, at some cost in efficiency.</p>
<p>Since D-Bus 1.7 it is safe to call this function from any thread, any number of times (but it must be called before any other libdbus API is used).</p>
<p>In D-Bus 1.6 or older, this function must be called in the main thread before any other thread starts. As a result, it is not sufficient to call this function in a library or plugin, unless the library or plugin imposes a similar requirement on its callers.</p>
<p><a class="el" href="group__DBusMemory.html#ga01912903e39428872920d861ef565bac" title="Frees all memory allocated internally by libdbus and reverses the effects of dbus_threads_init().">dbus_shutdown()</a> reverses the effects of this function when it resets all global state in libdbus.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd><a class="el" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a> on success, <a class="el" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a> if not enough memory </dd></dl>
<p>Definition at line <a class="el" href="dbus-threads_8c_source.html#l00438">438</a> of file <a class="el" href="dbus-threads_8c_source.html">dbus-threads.c</a>.</p>
<p>References <a class="el" href="dbus-threads_8c_source.html#l00391">dbus_threads_init()</a>, and <a class="el" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.</p>
<p>Referenced by <a class="el" href="dbus-threads_8c_source.html#l00077">_dbus_cmutex_new_at_location()</a>, <a class="el" href="dbus-threads_8c_source.html#l00181">_dbus_condvar_new()</a>, and <a class="el" href="dbus-threads_8c_source.html#l00053">_dbus_rmutex_new_at_location()</a>.</p>
</div>
</div>
</div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:34 for D-Bus by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>