|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21573/root/usr/share/devhelp/books/dbus/api/ |
Upload File : |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>D-Bus: Thread functions</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</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>
<li><a href="pages.html"><span>Related Pages</span></a></li>
</ul></div>
<h1>Thread functions<br>
<small>
[<a class="el" href="group__DBusInternals.html">D-Bus secret internal implementation details</a>]</small>
</h1><a class="el" href="group__DBusThreadsInternals.html#ge6eafe138e9c317bfb25971d1d8bef2d">_dbus_mutex_lock()</a>, etc.
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#ga68763a20debe2babcf441da8df6684c">_dbus_mutex_new</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a new mutex using the function supplied to <a class="el" href="group__DBusThreads.html#ga9a4ed445c77af3afa0dbdbb9d85afd4">dbus_threads_init()</a>, or creates a no-op mutex if threads are not initialized. <a href="#ga68763a20debe2babcf441da8df6684c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#g5b22688470ddee6e7b9c9b6eb751fa2e">_dbus_mutex_new_at_location</a> (<a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> **location_p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">This does the same thing as _dbus_mutex_new. <a href="#g5b22688470ddee6e7b9c9b6eb751fa2e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gf9370643f45e9491d98a6819b422af5c"></a><!-- doxytag: member="DBusThreadsInternals::_dbus_mutex_free" ref="gf9370643f45e9491d98a6819b422af5c" args="(DBusMutex *mutex)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#gf9370643f45e9491d98a6819b422af5c">_dbus_mutex_free</a> (<a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees a mutex created with dbus_mutex_new(); does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gfd7f94bf0c265660749ffa690e76248a"></a><!-- doxytag: member="DBusThreadsInternals::_dbus_mutex_free_at_location" ref="gfd7f94bf0c265660749ffa690e76248a" args="(DBusMutex **location_p)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#gfd7f94bf0c265660749ffa690e76248a">_dbus_mutex_free_at_location</a> (<a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> **location_p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees a mutex and removes it from the uninitialized_mutex_list; does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#ge6eafe138e9c317bfb25971d1d8bef2d">_dbus_mutex_lock</a> (<a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Locks a mutex. <a href="#ge6eafe138e9c317bfb25971d1d8bef2d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#g94dcc555488e5d677f10bd3898d61c00">_dbus_mutex_unlock</a> (<a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Unlocks a mutex. <a href="#g94dcc555488e5d677f10bd3898d61c00"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#g454b138bcbd419d38b3da6b707e46998">_dbus_condvar_new</a> (void)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a new condition variable using the function supplied to <a class="el" href="group__DBusThreads.html#ga9a4ed445c77af3afa0dbdbb9d85afd4">dbus_threads_init()</a>, or creates a no-op condition variable if threads are not initialized. <a href="#g454b138bcbd419d38b3da6b707e46998"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#g859c5830e3c212323c1d6dafee3858a1">_dbus_condvar_new_at_location</a> (<a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> **location_p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">This does the same thing as _dbus_condvar_new. <a href="#g859c5830e3c212323c1d6dafee3858a1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="gff04b7377b6ab0cc22fee6a2811dde84"></a><!-- doxytag: member="DBusThreadsInternals::_dbus_condvar_free" ref="gff04b7377b6ab0cc22fee6a2811dde84" args="(DBusCondVar *cond)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#gff04b7377b6ab0cc22fee6a2811dde84">_dbus_condvar_free</a> (<a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> *cond)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees a conditional variable created with dbus_condvar_new(); does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="g29444a34b569fca22fac48067832aacd"></a><!-- doxytag: member="DBusThreadsInternals::_dbus_condvar_free_at_location" ref="g29444a34b569fca22fac48067832aacd" args="(DBusCondVar **location_p)" -->
void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#g29444a34b569fca22fac48067832aacd">_dbus_condvar_free_at_location</a> (<a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> **location_p)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Frees a conditional variable and removes it from the uninitialized_condvar_list; does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#g393c0cfdec998dc5abe49480ac21ea51">_dbus_condvar_wait</a> (<a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> *cond, <a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Atomically unlocks the mutex and waits for the conditions variable to be signalled. <a href="#g393c0cfdec998dc5abe49480ac21ea51"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__DBusTypes.html#g39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#gac7b2117e5479ca6858734b59cfb9259">_dbus_condvar_wait_timeout</a> (<a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> *cond, <a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> *mutex, int timeout_milliseconds)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Atomically unlocks the mutex and waits for the conditions variable to be signalled, or for a timeout. <a href="#gac7b2117e5479ca6858734b59cfb9259"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#g8af2fd84773022e7e7ce1f21f0126203">_dbus_condvar_wake_one</a> (<a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> *cond)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">If there are threads waiting on the condition variable, wake up exactly one. <a href="#g8af2fd84773022e7e7ce1f21f0126203"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__DBusThreadsInternals.html#g1a9ce112b6bc72feccd34f9251744e76">_dbus_condvar_wake_all</a> (<a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> *cond)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">If there are threads waiting on the condition variable, wake up all of them. <a href="#g1a9ce112b6bc72feccd34f9251744e76"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<a class="el" href="group__DBusThreadsInternals.html#ge6eafe138e9c317bfb25971d1d8bef2d">_dbus_mutex_lock()</a>, etc.
<p>
Functions and macros related to threads and thread locks. <hr><h2>Function Documentation</h2>
<a class="anchor" name="g454b138bcbd419d38b3da6b707e46998"></a><!-- doxytag: member="dbus-threads.c::_dbus_condvar_new" ref="g454b138bcbd419d38b3da6b707e46998" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a>* _dbus_condvar_new </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a new condition variable using the function supplied to <a class="el" href="group__DBusThreads.html#ga9a4ed445c77af3afa0dbdbb9d85afd4">dbus_threads_init()</a>, or creates a no-op condition variable if threads are not initialized.
<p>
May return <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> even if threads are initialized, indicating out-of-memory.<p>
<dl compact><dt><b>Returns:</b></dt><dd>new mutex or <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> </dd></dl>
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00180">180</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-threads_8h-source.html#l00170">DBusThreadFunctions::condvar_new</a>.
<p>
Referenced by <a class="el" href="dbus-threads_8c-source.html#l00200">_dbus_condvar_new_at_location()</a>.
</div>
</div><p>
<a class="anchor" name="g859c5830e3c212323c1d6dafee3858a1"></a><!-- doxytag: member="dbus-threads.c::_dbus_condvar_new_at_location" ref="g859c5830e3c212323c1d6dafee3858a1" args="(DBusCondVar **location_p)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void _dbus_condvar_new_at_location </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> ** </td>
<td class="paramname"> <em>location_p</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
This does the same thing as _dbus_condvar_new.
<p>
It however gives another level of indirection by allocating a pointer to point to the condvar location. This allows the threading module to swap out dummy condvars for real a real condvar so libraries can initialize threads even after the D-Bus API has been used.<p>
<dl compact><dt><b>Returns:</b></dt><dd>the location of a new condvar or <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> on OOM </dd></dl>
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00200">200</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-threads_8c-source.html#l00220">_dbus_condvar_free()</a>, <a class="el" href="dbus-threads_8c-source.html#l00180">_dbus_condvar_new()</a>, <a class="el" href="dbus-memory_8c-source.html#l00687">_dbus_current_generation</a>, <a class="el" href="dbus-list_8c-source.html#l00246">_dbus_list_append()</a>, and <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.
<p>
Referenced by <a class="el" href="dbus-connection_8c-source.html#l01163">_dbus_connection_new_for_transport()</a>.
</div>
</div><p>
<a class="anchor" name="g393c0cfdec998dc5abe49480ac21ea51"></a><!-- doxytag: member="dbus-threads.c::_dbus_condvar_wait" ref="g393c0cfdec998dc5abe49480ac21ea51" args="(DBusCondVar *cond, DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void _dbus_condvar_wait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> * </td>
<td class="paramname"> <em>cond</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> * </td>
<td class="paramname"> <em>mutex</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Atomically unlocks the mutex and waits for the conditions variable to be signalled.
<p>
Locks the mutex again before returning. Does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer.
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00250">250</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-threads_8h-source.html#l00172">DBusThreadFunctions::condvar_wait</a>.
</div>
</div><p>
<a class="anchor" name="gac7b2117e5479ca6858734b59cfb9259"></a><!-- doxytag: member="dbus-threads.c::_dbus_condvar_wait_timeout" ref="gac7b2117e5479ca6858734b59cfb9259" args="(DBusCondVar *cond, DBusMutex *mutex, int timeout_milliseconds)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__DBusTypes.html#g39c9cb0f3a2a8ad6f55cc4855d035349">dbus_bool_t</a> _dbus_condvar_wait_timeout </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> * </td>
<td class="paramname"> <em>cond</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> * </td>
<td class="paramname"> <em>mutex</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>timeout_milliseconds</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Atomically unlocks the mutex and waits for the conditions variable to be signalled, or for a timeout.
<p>
Locks the mutex again before returning. Does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer. Return value is <a class="el" href="group__DBusMacros.html#ga93f0eb578d23995850d61f7d61c55c1">FALSE</a> if we timed out, <a class="el" href="group__DBusMacros.html#ga8cecfc5c5c054d2875c03e77b7be15d">TRUE</a> otherwise.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>cond</em> </td><td>the condition variable </td></tr>
<tr><td valign="top"></td><td valign="top"><em>mutex</em> </td><td>the mutex </td></tr>
<tr><td valign="top"></td><td valign="top"><em>timeout_milliseconds</em> </td><td>the maximum time to wait </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__DBusMacros.html#ga93f0eb578d23995850d61f7d61c55c1">FALSE</a> if the timeout occurred, <a class="el" href="group__DBusMacros.html#ga8cecfc5c5c054d2875c03e77b7be15d">TRUE</a> if not </dd></dl>
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00269">269</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-threads_8h-source.html#l00172">DBusThreadFunctions::condvar_wait</a>, <a class="el" href="dbus-threads_8h-source.html#l00173">DBusThreadFunctions::condvar_wait_timeout</a>, and <a class="el" href="group__DBusMacros.html#ga8cecfc5c5c054d2875c03e77b7be15d">TRUE</a>.
</div>
</div><p>
<a class="anchor" name="g1a9ce112b6bc72feccd34f9251744e76"></a><!-- doxytag: member="dbus-threads.c::_dbus_condvar_wake_all" ref="g1a9ce112b6bc72feccd34f9251744e76" args="(DBusCondVar *cond)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void _dbus_condvar_wake_all </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> * </td>
<td class="paramname"> <em>cond</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
If there are threads waiting on the condition variable, wake up all of them.
<p>
Does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer.
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00297">297</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-threads_8h-source.html#l00175">DBusThreadFunctions::condvar_wake_all</a>.
</div>
</div><p>
<a class="anchor" name="g8af2fd84773022e7e7ce1f21f0126203"></a><!-- doxytag: member="dbus-threads.c::_dbus_condvar_wake_one" ref="g8af2fd84773022e7e7ce1f21f0126203" args="(DBusCondVar *cond)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void _dbus_condvar_wake_one </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#ga14cd16a336a85b5edbca3c237c3829e">DBusCondVar</a> * </td>
<td class="paramname"> <em>cond</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
If there are threads waiting on the condition variable, wake up exactly one.
<p>
Does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer.
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00285">285</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-threads_8h-source.html#l00174">DBusThreadFunctions::condvar_wake_one</a>.
</div>
</div><p>
<a class="anchor" name="ge6eafe138e9c317bfb25971d1d8bef2d"></a><!-- doxytag: member="dbus-threads.c::_dbus_mutex_lock" ref="ge6eafe138e9c317bfb25971d1d8bef2d" args="(DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void _dbus_mutex_lock </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> * </td>
<td class="paramname"> <em>mutex</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Locks a mutex.
<p>
Does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer. Locks may be recursive if threading implementation initialized recursive locks.
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00143">143</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-threads_8h-source.html#l00167">DBusThreadFunctions::mutex_lock</a>, and <a class="el" href="dbus-threads_8h-source.html#l00179">DBusThreadFunctions::recursive_mutex_lock</a>.
<p>
Referenced by <a class="el" href="dbus-dataslot_8c-source.html#l00067">_dbus_data_slot_allocator_alloc()</a>, <a class="el" href="dbus-dataslot_8c-source.html#l00163">_dbus_data_slot_allocator_free()</a>, <a class="el" href="dbus-dataslot_8c-source.html#l00296">_dbus_data_slot_list_get()</a>, and <a class="el" href="dbus-dataslot_8c-source.html#l00235">_dbus_data_slot_list_set()</a>.
</div>
</div><p>
<a class="anchor" name="ga68763a20debe2babcf441da8df6684c"></a><!-- doxytag: member="dbus-threads.c::_dbus_mutex_new" ref="ga68763a20debe2babcf441da8df6684c" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a>* _dbus_mutex_new </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a new mutex using the function supplied to <a class="el" href="group__DBusThreads.html#ga9a4ed445c77af3afa0dbdbb9d85afd4">dbus_threads_init()</a>, or creates a no-op mutex if threads are not initialized.
<p>
May return <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> even if threads are initialized, indicating out-of-memory.<p>
<dl compact><dt><b>Returns:</b></dt><dd>new mutex or <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> </dd></dl>
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00068">68</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-threads_8h-source.html#l00165">DBusThreadFunctions::mutex_new</a>, and <a class="el" href="dbus-threads_8h-source.html#l00177">DBusThreadFunctions::recursive_mutex_new</a>.
<p>
Referenced by <a class="el" href="dbus-threads_8c-source.html#l00088">_dbus_mutex_new_at_location()</a>.
</div>
</div><p>
<a class="anchor" name="g5b22688470ddee6e7b9c9b6eb751fa2e"></a><!-- doxytag: member="dbus-threads.c::_dbus_mutex_new_at_location" ref="g5b22688470ddee6e7b9c9b6eb751fa2e" args="(DBusMutex **location_p)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void _dbus_mutex_new_at_location </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> ** </td>
<td class="paramname"> <em>location_p</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
This does the same thing as _dbus_mutex_new.
<p>
It however gives another level of indirection by allocating a pointer to point to the mutex location. This allows the threading module to swap out dummy mutexes for real a real mutex so libraries can initialize threads even after the D-Bus API has been used.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>location_p</em> </td><td>the location of the new mutex, can return <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> on OOM </td></tr>
</table>
</dl>
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00088">88</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-internals_8h-source.html#l00109">_dbus_assert</a>, <a class="el" href="dbus-memory_8c-source.html#l00687">_dbus_current_generation</a>, <a class="el" href="dbus-list_8c-source.html#l00246">_dbus_list_append()</a>, <a class="el" href="dbus-threads_8c-source.html#l00109">_dbus_mutex_free()</a>, <a class="el" href="dbus-threads_8c-source.html#l00068">_dbus_mutex_new()</a>, and <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>.
<p>
Referenced by <a class="el" href="dbus-connection_8c-source.html#l01163">_dbus_connection_new_for_transport()</a>, and <a class="el" href="dbus-server_8c-source.html#l00096">_dbus_server_init_base()</a>.
</div>
</div><p>
<a class="anchor" name="g94dcc555488e5d677f10bd3898d61c00"></a><!-- doxytag: member="dbus-threads.c::_dbus_mutex_unlock" ref="g94dcc555488e5d677f10bd3898d61c00" args="(DBusMutex *mutex)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void _dbus_mutex_unlock </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__DBusThreads.html#g4eb021cd6cd0830423eac2738e0ddc40">DBusMutex</a> * </td>
<td class="paramname"> <em>mutex</em> </td>
<td> ) </td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Unlocks a mutex.
<p>
Does nothing if passed a <a class="el" href="group__DBusMacros.html#g070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> pointer.<p>
<dl compact><dt><b>Returns:</b></dt><dd><a class="el" href="group__DBusMacros.html#ga8cecfc5c5c054d2875c03e77b7be15d">TRUE</a> on success </dd></dl>
<p>
Definition at line <a class="el" href="dbus-threads_8c-source.html#l00160">160</a> of file <a class="el" href="dbus-threads_8c-source.html">dbus-threads.c</a>.
<p>
References <a class="el" href="dbus-threads_8h-source.html#l00168">DBusThreadFunctions::mutex_unlock</a>, and <a class="el" href="dbus-threads_8h-source.html#l00180">DBusThreadFunctions::recursive_mutex_unlock</a>.
<p>
Referenced by <a class="el" href="dbus-dataslot_8c-source.html#l00067">_dbus_data_slot_allocator_alloc()</a>, <a class="el" href="dbus-dataslot_8c-source.html#l00163">_dbus_data_slot_allocator_free()</a>, <a class="el" href="dbus-dataslot_8c-source.html#l00296">_dbus_data_slot_list_get()</a>, and <a class="el" href="dbus-dataslot_8c-source.html#l00235">_dbus_data_slot_list_set()</a>.
</div>
</div><p>
<hr size="1"><address style="align: right;"><small>Generated on Mon Dec 14 22:26:15 2009 for D-Bus by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>