123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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"/>
- <meta name="generator" content="Doxygen 1.8.17"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>MQTT C Client Libraries Internals: Thread.c File Reference</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
- <td id="projectalign" style="padding-left: 0.5em;">
- <div id="projectname">MQTT C Client Libraries Internals
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.17 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- /* @license-end */
- </script>
- <script type="text/javascript" src="menudata.js"></script>
- <script type="text/javascript" src="menu.js"></script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(function() {
- initMenu('',true,false,'search.php','Search');
- $(document).ready(function() { init_search(); });
- });
- /* @license-end */</script>
- <div id="main-nav"></div>
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- </div><!-- top -->
- <div class="header">
- <div class="summary">
- <a href="#define-members">Macros</a> |
- <a href="#func-members">Functions</a> </div>
- <div class="headertitle">
- <div class="title">Thread.c File Reference</div> </div>
- </div><!--header-->
- <div class="contents">
- <p>Threading related functions.
- <a href="#details">More...</a></p>
- <div class="textblock"><code>#include "Thread.h"</code><br />
- <code>#include "Log.h"</code><br />
- <code>#include "StackTrace.h"</code><br />
- <code>#include <errno.h></code><br />
- <code>#include <unistd.h></code><br />
- <code>#include <sys/time.h></code><br />
- <code>#include <fcntl.h></code><br />
- <code>#include <stdio.h></code><br />
- <code>#include <sys/stat.h></code><br />
- <code>#include <limits.h></code><br />
- <code>#include <stdlib.h></code><br />
- <code>#include "OsWrapper.h"</code><br />
- </div><div class="textblock"><div class="dynheader">
- Include dependency graph for Thread.c:</div>
- <div class="dyncontent">
- <div class="center"><img src="Thread_8c__incl.png" border="0" usemap="#Thread_8c" alt=""/></div>
- <map name="Thread_8c" id="Thread_8c">
- <area shape="rect" title="Threading related functions." alt="" coords="321,5,393,32"/>
- <area shape="rect" title=" " alt="" coords="5,80,67,107"/>
- <area shape="rect" title=" " alt="" coords="91,80,157,107"/>
- <area shape="rect" title=" " alt="" coords="182,80,263,107"/>
- <area shape="rect" title=" " alt="" coords="287,80,345,107"/>
- <area shape="rect" title=" " alt="" coords="369,80,429,107"/>
- <area shape="rect" title=" " alt="" coords="453,80,531,107"/>
- <area shape="rect" title=" " alt="" coords="555,80,618,107"/>
- <area shape="rect" title=" " alt="" coords="642,80,705,107"/>
- </map>
- </div>
- </div><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
- Functions</h2></td></tr>
- <tr class="memitem:a25288643d5e1a2ab1369132a80c58ce4"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#a25288643d5e1a2ab1369132a80c58ce4">Thread_start</a> (thread_fn fn, void *parameter)</td></tr>
- <tr class="memdesc:a25288643d5e1a2ab1369132a80c58ce4"><td class="mdescLeft"> </td><td class="mdescRight">Start a new thread. <a href="Thread_8c.html#a25288643d5e1a2ab1369132a80c58ce4">More...</a><br /></td></tr>
- <tr class="separator:a25288643d5e1a2ab1369132a80c58ce4"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a4bd33fc4aeea77c32f7145bc8582b535"><td class="memItemLeft" align="right" valign="top"><a id="a4bd33fc4aeea77c32f7145bc8582b535"></a>
- int </td><td class="memItemRight" valign="bottom"><b>Thread_set_name</b> (const char *thread_name)</td></tr>
- <tr class="separator:a4bd33fc4aeea77c32f7145bc8582b535"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a6c1b6aaeb2f7e1d5b4a4936f0568b868"><td class="memItemLeft" align="right" valign="top">mutex_type </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#a6c1b6aaeb2f7e1d5b4a4936f0568b868">Thread_create_mutex</a> (int *rc)</td></tr>
- <tr class="memdesc:a6c1b6aaeb2f7e1d5b4a4936f0568b868"><td class="mdescLeft"> </td><td class="mdescRight">Create a new mutex. <a href="Thread_8c.html#a6c1b6aaeb2f7e1d5b4a4936f0568b868">More...</a><br /></td></tr>
- <tr class="separator:a6c1b6aaeb2f7e1d5b4a4936f0568b868"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a7e92185eb22775c76e1b6b8865468f17"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#a7e92185eb22775c76e1b6b8865468f17">Thread_lock_mutex</a> (mutex_type mutex)</td></tr>
- <tr class="memdesc:a7e92185eb22775c76e1b6b8865468f17"><td class="mdescLeft"> </td><td class="mdescRight">Lock a mutex which has alrea. <a href="Thread_8c.html#a7e92185eb22775c76e1b6b8865468f17">More...</a><br /></td></tr>
- <tr class="separator:a7e92185eb22775c76e1b6b8865468f17"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a5faf758226199e7cf93f6b489aca07f7"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#a5faf758226199e7cf93f6b489aca07f7">Thread_unlock_mutex</a> (mutex_type mutex)</td></tr>
- <tr class="memdesc:a5faf758226199e7cf93f6b489aca07f7"><td class="mdescLeft"> </td><td class="mdescRight">Unlock a mutex which has already been locked. <a href="Thread_8c.html#a5faf758226199e7cf93f6b489aca07f7">More...</a><br /></td></tr>
- <tr class="separator:a5faf758226199e7cf93f6b489aca07f7"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ab586558bf9d7030f479ca574ea7e55a4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#ab586558bf9d7030f479ca574ea7e55a4">Thread_destroy_mutex</a> (mutex_type mutex)</td></tr>
- <tr class="memdesc:ab586558bf9d7030f479ca574ea7e55a4"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a mutex which has already been created. <a href="Thread_8c.html#ab586558bf9d7030f479ca574ea7e55a4">More...</a><br /></td></tr>
- <tr class="separator:ab586558bf9d7030f479ca574ea7e55a4"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a216e79bc196440343aa802dfad8dc38b"><td class="memItemLeft" align="right" valign="top">thread_id_type </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#a216e79bc196440343aa802dfad8dc38b">Thread_getid</a> (void)</td></tr>
- <tr class="memdesc:a216e79bc196440343aa802dfad8dc38b"><td class="mdescLeft"> </td><td class="mdescRight">Get the thread id of the thread from which this function is called. <a href="Thread_8c.html#a216e79bc196440343aa802dfad8dc38b">More...</a><br /></td></tr>
- <tr class="separator:a216e79bc196440343aa802dfad8dc38b"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a3b9b6cb543ee55442d2037a971f651db"><td class="memItemLeft" align="right" valign="top">sem_type </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#a3b9b6cb543ee55442d2037a971f651db">Thread_create_sem</a> (int *rc)</td></tr>
- <tr class="memdesc:a3b9b6cb543ee55442d2037a971f651db"><td class="mdescLeft"> </td><td class="mdescRight">Create a new semaphore. <a href="Thread_8c.html#a3b9b6cb543ee55442d2037a971f651db">More...</a><br /></td></tr>
- <tr class="separator:a3b9b6cb543ee55442d2037a971f651db"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a4d0bbfc059da3cd10626244d3468d319"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#a4d0bbfc059da3cd10626244d3468d319">Thread_wait_sem</a> (sem_type sem, int timeout)</td></tr>
- <tr class="memdesc:a4d0bbfc059da3cd10626244d3468d319"><td class="mdescLeft"> </td><td class="mdescRight">Wait for a semaphore to be posted, or timeout. <a href="Thread_8c.html#a4d0bbfc059da3cd10626244d3468d319">More...</a><br /></td></tr>
- <tr class="separator:a4d0bbfc059da3cd10626244d3468d319"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ad327c467c568b27be4c3676fc698e129"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#ad327c467c568b27be4c3676fc698e129">Thread_check_sem</a> (sem_type sem)</td></tr>
- <tr class="memdesc:ad327c467c568b27be4c3676fc698e129"><td class="mdescLeft"> </td><td class="mdescRight">Check to see if a semaphore has been posted, without waiting The semaphore will be unchanged, if the return value is false. <a href="Thread_8c.html#ad327c467c568b27be4c3676fc698e129">More...</a><br /></td></tr>
- <tr class="separator:ad327c467c568b27be4c3676fc698e129"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ac023f527bed9c6c3a20244fa7efe272c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#ac023f527bed9c6c3a20244fa7efe272c">Thread_post_sem</a> (sem_type sem)</td></tr>
- <tr class="memdesc:ac023f527bed9c6c3a20244fa7efe272c"><td class="mdescLeft"> </td><td class="mdescRight">Post a semaphore. <a href="Thread_8c.html#ac023f527bed9c6c3a20244fa7efe272c">More...</a><br /></td></tr>
- <tr class="separator:ac023f527bed9c6c3a20244fa7efe272c"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ad075ec07f801ac1a2a7dee7097048182"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#ad075ec07f801ac1a2a7dee7097048182">Thread_destroy_sem</a> (sem_type sem)</td></tr>
- <tr class="memdesc:ad075ec07f801ac1a2a7dee7097048182"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a semaphore which has already been created. <a href="Thread_8c.html#ad075ec07f801ac1a2a7dee7097048182">More...</a><br /></td></tr>
- <tr class="separator:ad075ec07f801ac1a2a7dee7097048182"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:afdd152c518f968c777012d7dfb20ef96"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcond__type__struct.html">cond_type</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#afdd152c518f968c777012d7dfb20ef96">Thread_create_cond</a> (int *rc)</td></tr>
- <tr class="memdesc:afdd152c518f968c777012d7dfb20ef96"><td class="mdescLeft"> </td><td class="mdescRight">Create a new condition variable. <a href="Thread_8c.html#afdd152c518f968c777012d7dfb20ef96">More...</a><br /></td></tr>
- <tr class="separator:afdd152c518f968c777012d7dfb20ef96"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a7b0d40dc1603a6e93db0ee970bb6750f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#a7b0d40dc1603a6e93db0ee970bb6750f">Thread_signal_cond</a> (<a class="el" href="structcond__type__struct.html">cond_type</a> condvar)</td></tr>
- <tr class="memdesc:a7b0d40dc1603a6e93db0ee970bb6750f"><td class="mdescLeft"> </td><td class="mdescRight">Signal a condition variable. <a href="Thread_8c.html#a7b0d40dc1603a6e93db0ee970bb6750f">More...</a><br /></td></tr>
- <tr class="separator:a7b0d40dc1603a6e93db0ee970bb6750f"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:acd23266878de6faaee0a972ef74c4db6"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#acd23266878de6faaee0a972ef74c4db6">Thread_wait_cond</a> (<a class="el" href="structcond__type__struct.html">cond_type</a> condvar, int timeout_ms)</td></tr>
- <tr class="memdesc:acd23266878de6faaee0a972ef74c4db6"><td class="mdescLeft"> </td><td class="mdescRight">Wait with a timeout (ms) for condition variable. <a href="Thread_8c.html#acd23266878de6faaee0a972ef74c4db6">More...</a><br /></td></tr>
- <tr class="separator:acd23266878de6faaee0a972ef74c4db6"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a95309628f2c15de1f3ea8047b086a707"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="Thread_8c.html#a95309628f2c15de1f3ea8047b086a707">Thread_destroy_cond</a> (<a class="el" href="structcond__type__struct.html">cond_type</a> condvar)</td></tr>
- <tr class="memdesc:a95309628f2c15de1f3ea8047b086a707"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a condition variable. <a href="Thread_8c.html#a95309628f2c15de1f3ea8047b086a707">More...</a><br /></td></tr>
- <tr class="separator:a95309628f2c15de1f3ea8047b086a707"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
- <div class="textblock"><p>Threading related functions. </p>
- <p>Used to create platform independent threading functions </p>
- </div><h2 class="groupheader">Function Documentation</h2>
- <a id="ad327c467c568b27be4c3676fc698e129"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ad327c467c568b27be4c3676fc698e129">◆ </a></span>Thread_check_sem()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_check_sem </td>
- <td>(</td>
- <td class="paramtype">sem_type </td>
- <td class="paramname"><em>sem</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Check to see if a semaphore has been posted, without waiting The semaphore will be unchanged, if the return value is false. </p>
- <p>The semaphore will have been decremented, if the return value is true. </p><dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">sem</td><td>the semaphore </td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>0 (false) or 1 (true) </dd></dl>
- </div>
- </div>
- <a id="afdd152c518f968c777012d7dfb20ef96"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#afdd152c518f968c777012d7dfb20ef96">◆ </a></span>Thread_create_cond()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname"><a class="el" href="structcond__type__struct.html">cond_type</a> Thread_create_cond </td>
- <td>(</td>
- <td class="paramtype">int * </td>
- <td class="paramname"><em>rc</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Create a new condition variable. </p>
- <dl class="section return"><dt>Returns</dt><dd>the condition variable struct </dd></dl>
- <div class="dynheader">
- Here is the call graph for this function:</div>
- <div class="dyncontent">
- <div class="center"><img src="Thread_8c_afdd152c518f968c777012d7dfb20ef96_cgraph.png" border="0" usemap="#Thread_8c_afdd152c518f968c777012d7dfb20ef96_cgraph" alt=""/></div>
- <map name="Thread_8c_afdd152c518f968c777012d7dfb20ef96_cgraph" id="Thread_8c_afdd152c518f968c777012d7dfb20ef96_cgraph">
- <area shape="rect" title="Create a new condition variable." alt="" coords="5,5,145,32"/>
- <area shape="rect" href="Log_8c.html#a669722e3f57811871f97c12392aba85d" title="Log a message." alt="" coords="193,5,237,32"/>
- </map>
- </div>
- </div>
- </div>
- <a id="a6c1b6aaeb2f7e1d5b4a4936f0568b868"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a6c1b6aaeb2f7e1d5b4a4936f0568b868">◆ </a></span>Thread_create_mutex()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">mutex_type Thread_create_mutex </td>
- <td>(</td>
- <td class="paramtype">int * </td>
- <td class="paramname"><em>rc</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Create a new mutex. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">rc</td><td>return code: 0 for success, negative otherwise </td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>the new mutex </dd></dl>
- </div>
- </div>
- <a id="a3b9b6cb543ee55442d2037a971f651db"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a3b9b6cb543ee55442d2037a971f651db">◆ </a></span>Thread_create_sem()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">sem_type Thread_create_sem </td>
- <td>(</td>
- <td class="paramtype">int * </td>
- <td class="paramname"><em>rc</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Create a new semaphore. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">rc</td><td>return code: 0 for success, negative otherwise </td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>the new condition variable </dd></dl>
- </div>
- </div>
- <a id="a95309628f2c15de1f3ea8047b086a707"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a95309628f2c15de1f3ea8047b086a707">◆ </a></span>Thread_destroy_cond()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_destroy_cond </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="structcond__type__struct.html">cond_type</a> </td>
- <td class="paramname"><em>condvar</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Destroy a condition variable. </p>
- <dl class="section return"><dt>Returns</dt><dd>completion code </dd></dl>
- </div>
- </div>
- <a id="ab586558bf9d7030f479ca574ea7e55a4"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ab586558bf9d7030f479ca574ea7e55a4">◆ </a></span>Thread_destroy_mutex()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_destroy_mutex </td>
- <td>(</td>
- <td class="paramtype">mutex_type </td>
- <td class="paramname"><em>mutex</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Destroy a mutex which has already been created. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">mutex</td><td>the mutex </td></tr>
- </table>
- </dd>
- </dl>
- </div>
- </div>
- <a id="ad075ec07f801ac1a2a7dee7097048182"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ad075ec07f801ac1a2a7dee7097048182">◆ </a></span>Thread_destroy_sem()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_destroy_sem </td>
- <td>(</td>
- <td class="paramtype">sem_type </td>
- <td class="paramname"><em>sem</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Destroy a semaphore which has already been created. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">sem</td><td>the semaphore </td></tr>
- </table>
- </dd>
- </dl>
- </div>
- </div>
- <a id="a216e79bc196440343aa802dfad8dc38b"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a216e79bc196440343aa802dfad8dc38b">◆ </a></span>Thread_getid()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">thread_id_type Thread_getid </td>
- <td>(</td>
- <td class="paramtype">void </td>
- <td class="paramname"></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Get the thread id of the thread from which this function is called. </p>
- <dl class="section return"><dt>Returns</dt><dd>thread id, type varying according to OS </dd></dl>
- </div>
- </div>
- <a id="a7e92185eb22775c76e1b6b8865468f17"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a7e92185eb22775c76e1b6b8865468f17">◆ </a></span>Thread_lock_mutex()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_lock_mutex </td>
- <td>(</td>
- <td class="paramtype">mutex_type </td>
- <td class="paramname"><em>mutex</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Lock a mutex which has alrea. </p>
- <dl class="section return"><dt>Returns</dt><dd>completion code, 0 is success </dd></dl>
- </div>
- </div>
- <a id="ac023f527bed9c6c3a20244fa7efe272c"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ac023f527bed9c6c3a20244fa7efe272c">◆ </a></span>Thread_post_sem()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_post_sem </td>
- <td>(</td>
- <td class="paramtype">sem_type </td>
- <td class="paramname"><em>sem</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Post a semaphore. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">sem</td><td>the semaphore </td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>0 on success </dd></dl>
- </div>
- </div>
- <a id="a7b0d40dc1603a6e93db0ee970bb6750f"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a7b0d40dc1603a6e93db0ee970bb6750f">◆ </a></span>Thread_signal_cond()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_signal_cond </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="structcond__type__struct.html">cond_type</a> </td>
- <td class="paramname"><em>condvar</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Signal a condition variable. </p>
- <dl class="section return"><dt>Returns</dt><dd>completion code </dd></dl>
- </div>
- </div>
- <a id="a25288643d5e1a2ab1369132a80c58ce4"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a25288643d5e1a2ab1369132a80c58ce4">◆ </a></span>Thread_start()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void Thread_start </td>
- <td>(</td>
- <td class="paramtype">thread_fn </td>
- <td class="paramname"><em>fn</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">void * </td>
- <td class="paramname"><em>parameter</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Start a new thread. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">fn</td><td>the function to run, must be of the correct signature </td></tr>
- <tr><td class="paramname">parameter</td><td>pointer to the function parameter, can be NULL </td></tr>
- </table>
- </dd>
- </dl>
- </div>
- </div>
- <a id="a5faf758226199e7cf93f6b489aca07f7"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a5faf758226199e7cf93f6b489aca07f7">◆ </a></span>Thread_unlock_mutex()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_unlock_mutex </td>
- <td>(</td>
- <td class="paramtype">mutex_type </td>
- <td class="paramname"><em>mutex</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Unlock a mutex which has already been locked. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">mutex</td><td>the mutex </td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>completion code, 0 is success </dd></dl>
- </div>
- </div>
- <a id="acd23266878de6faaee0a972ef74c4db6"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#acd23266878de6faaee0a972ef74c4db6">◆ </a></span>Thread_wait_cond()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_wait_cond </td>
- <td>(</td>
- <td class="paramtype"><a class="el" href="structcond__type__struct.html">cond_type</a> </td>
- <td class="paramname"><em>condvar</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>timeout_ms</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Wait with a timeout (ms) for condition variable. </p>
- <dl class="section return"><dt>Returns</dt><dd>0 for success, ETIMEDOUT otherwise </dd></dl>
- </div>
- </div>
- <a id="a4d0bbfc059da3cd10626244d3468d319"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a4d0bbfc059da3cd10626244d3468d319">◆ </a></span>Thread_wait_sem()</h2>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">int Thread_wait_sem </td>
- <td>(</td>
- <td class="paramtype">sem_type </td>
- <td class="paramname"><em>sem</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>timeout</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Wait for a semaphore to be posted, or timeout. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">sem</td><td>the semaphore </td></tr>
- <tr><td class="paramname">timeout</td><td>the maximum time to wait, in milliseconds </td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>completion code </dd></dl>
- </div>
- </div>
- </div><!-- contents -->
- <!-- start footer part -->
- <hr class="footer"/><address class="footer"><small>
- Generated on Thu Sep 29 2022 11:34:46 for MQTT C Client Libraries Internals by  <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/>
- </a> 1.8.17
- </small></address>
- </body>
- </html>
|