summaryrefslogtreecommitdiff
path: root/docs/RTOS2/html/group__CMSIS__RTOS__MutexMgmt.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/RTOS2/html/group__CMSIS__RTOS__MutexMgmt.html')
-rw-r--r--docs/RTOS2/html/group__CMSIS__RTOS__MutexMgmt.html78
1 files changed, 39 insertions, 39 deletions
diff --git a/docs/RTOS2/html/group__CMSIS__RTOS__MutexMgmt.html b/docs/RTOS2/html/group__CMSIS__RTOS__MutexMgmt.html
index 9b6d2ee..e094921 100644
--- a/docs/RTOS2/html/group__CMSIS__RTOS__MutexMgmt.html
+++ b/docs/RTOS2/html/group__CMSIS__RTOS__MutexMgmt.html
@@ -254,18 +254,18 @@ size of provided memory for control block <p>The size (in bytes) of memory block
<dl class="section note"><dt>Note</dt><dd>The maximum amount of recursive locks possible is implementation specific, i.e. the type size used for the lock count. If the maximum amount of recursive locks is depleted mutex acquire might fail.</dd></dl>
<p><b>Code Example</b> </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os2_8h.html">cmsis_os2.h</a>&quot;</span></div>
-<div class="line"> </div>
-<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id; </div>
-<div class="line"> </div>
+<div class="line"> </div>
+<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id; </div>
+<div class="line"> </div>
<div class="line"><span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#structosMutexAttr__t">osMutexAttr_t</a> Thread_Mutex_attr = {</div>
<div class="line"> <span class="stringliteral">&quot;myThreadMutex&quot;</span>, <span class="comment">// human readable mutex name</span></div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga65c2482cc64a35d03871f3180f305926">osMutexRecursive</a>, <span class="comment">// attr_bits</span></div>
<div class="line"> NULL, <span class="comment">// memory for control block </span></div>
<div class="line"> 0U <span class="comment">// size for control block</span></div>
<div class="line">};</div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><span class="comment">// must be called from a thread context</span></div>
-<div class="line"><span class="keywordtype">void</span> UseMutexRecursively(<span class="keywordtype">int</span> count) {</div>
+<div class="line"><span class="keywordtype">void</span> UseMutexRecursively(<span class="keywordtype">int</span> count) {</div>
<div class="line"> osStatus_t result = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gabc54686ea0fc281823b1763422d2a924">osMutexAcquire</a>(mutex_id, <a class="code" href="group__CMSIS__RTOS__Definitions.html#ga9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// lock count is incremented, might fail when lock count is depleted</span></div>
<div class="line"> <span class="keywordflow">if</span> (result == <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div>
<div class="line"> <span class="keywordflow">if</span> (count &lt; 10) {</div>
@@ -292,38 +292,38 @@ size of provided memory for control block <p>The size (in bytes) of memory block
<p><b>Code Example</b></p>
<p>This example reveals a blocked high priority thread if <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga40fba270cb31a977b3bd551d41eb9599">osMutexPrioInherit</a> is removed.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os2_8h.html">cmsis_os2.h</a>&quot;</span></div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id; </div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#structosMutexAttr__t">osMutexAttr_t</a> Thread_Mutex_attr = {</div>
<div class="line"> <span class="stringliteral">&quot;myThreadMutex&quot;</span>, <span class="comment">// human readable mutex name</span></div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga40fba270cb31a977b3bd551d41eb9599">osMutexPrioInherit</a>, <span class="comment">// attr_bits</span></div>
<div class="line"> NULL, <span class="comment">// memory for control block </span></div>
<div class="line"> 0U <span class="comment">// size for control block</span></div>
<div class="line">};</div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> HighPrioThread(<span class="keywordtype">void</span> *argument) {</div>
-<div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a>(1000); <span class="comment">// wait 1s until start actual work</span></div>
+<div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a>(1000U); <span class="comment">// wait 1s until start actual work</span></div>
<div class="line"> <span class="keywordflow">while</span>(1) {</div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gabc54686ea0fc281823b1763422d2a924">osMutexAcquire</a>(mutex_id, <a class="code" href="group__CMSIS__RTOS__Definitions.html#ga9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// try to acquire mutex</span></div>
<div class="line"> <span class="comment">// do stuff</span></div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gaea629705703580ff58776bf73c8db915">osMutexRelease</a>(mutex_id);</div>
<div class="line"> }</div>
<div class="line">}</div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> MidPrioThread(<span class="keywordtype">void</span> *argument) {</div>
-<div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a>(1000); <span class="comment">// wait 1s until start actual work</span></div>
+<div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a>(1000U); <span class="comment">// wait 1s until start actual work</span></div>
<div class="line"> <span class="keywordflow">while</span>(1) {</div>
<div class="line"> <span class="comment">// do non blocking stuff</span></div>
<div class="line"> }</div>
<div class="line">}</div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> LowPrioThread(<span class="keywordtype">void</span> *argument) {</div>
<div class="line"> <span class="keywordflow">while</span>(1) {</div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gabc54686ea0fc281823b1763422d2a924">osMutexAcquire</a>(mutex_id, <a class="code" href="group__CMSIS__RTOS__Definitions.html#ga9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>);</div>
-<div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a>(5000); <span class="comment">// block mutex for 5s</span></div>
+<div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a>(5000U); <span class="comment">// block mutex for 5s</span></div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gaea629705703580ff58776bf73c8db915">osMutexRelease</a>(mutex_id);</div>
-<div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a>(5000); <span class="comment">// sleep for 5s</span></div>
+<div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a>(5000U); <span class="comment">// sleep for 5s</span></div>
<div class="line"> }</div>
<div class="line">}</div>
</div><!-- fragment --><p>During the first second the high and mid priority threads are delayed. Thus the low priority thread can start its work, acquires the mutex and delays while holding it.</p>
@@ -348,16 +348,16 @@ size of provided memory for control block <p>The size (in bytes) of memory block
<p><b>Code Example</b></p>
<p>This example reveals a blocked mutex if osMutexRobust is removed.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os2_8h.html">cmsis_os2.h</a>&quot;</span></div>
-<div class="line"> </div>
-<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id; </div>
-<div class="line"> </div>
+<div class="line"> </div>
+<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id;</div>
+<div class="line"> </div>
<div class="line"><span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#structosMutexAttr__t">osMutexAttr_t</a> Thread_Mutex_attr = {</div>
<div class="line"> <span class="stringliteral">&quot;myThreadMutex&quot;</span>, <span class="comment">// human readable mutex name</span></div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gaf0e1dee376798b4d516d164981526780">osMutexRobust</a>, <span class="comment">// attr_bits</span></div>
<div class="line"> NULL, <span class="comment">// memory for control block </span></div>
<div class="line"> 0U <span class="comment">// size for control block</span></div>
<div class="line">};</div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> Thread(<span class="keywordtype">void</span> *argument) {</div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gabc54686ea0fc281823b1763422d2a924">osMutexAcquire</a>(mutex_id, <a class="code" href="group__CMSIS__RTOS__Definitions.html#ga9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>);</div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaddaa452dd7610e4096647a566d3556fc">osThreadExit</a>();</div>
@@ -410,21 +410,21 @@ size of provided memory for control block <p>The size (in bytes) of memory block
<dl class="section note"><dt>Note</dt><dd>This function <b>cannot</b> be called from <a class="el" href="theory_of_operation.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl>
<p><b>Code Example</b> </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os2_8h.html">cmsis_os2.h</a>&quot;</span></div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id; </div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#structosMutexAttr__t">osMutexAttr_t</a> Thread_Mutex_attr = {</div>
<div class="line"> <span class="stringliteral">&quot;myThreadMutex&quot;</span>, <span class="comment">// human readable mutex name</span></div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga65c2482cc64a35d03871f3180f305926">osMutexRecursive</a> | <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga40fba270cb31a977b3bd551d41eb9599">osMutexPrioInherit</a>, <span class="comment">// attr_bits</span></div>
<div class="line"> NULL, <span class="comment">// memory for control block </span></div>
<div class="line"> 0U <span class="comment">// size for control block</span></div>
-<div class="line"> };</div>
-<div class="line"> </div>
+<div class="line">};</div>
+<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> CreateMutex (<span class="keywordtype">void</span>) {</div>
<div class="line"> mutex_id = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gab90920022ab944296821368ef6bb52f8">osMutexNew</a>(&amp;Thread_Mutex_attr);</div>
<div class="line"> <span class="keywordflow">if</span> (mutex_id != NULL) {</div>
<div class="line"> <span class="comment">// Mutex object created</span></div>
-<div class="line"> } </div>
+<div class="line"> }</div>
<div class="line">}</div>
</div><!-- fragment -->
</div>
@@ -496,21 +496,21 @@ size of provided memory for control block <p>The size (in bytes) of memory block
<ul>
<li><em>osOK:</em> the mutex has been obtained.</li>
<li><em>osErrorTimeout:</em> the mutex could not be obtained in the given time.</li>
+<li><em>osErrorResource:</em> the mutex could not be obtained when no <em>timeout</em> was specified.</li>
<li><em>osErrorParameter:</em> parameter <em>mutex_id</em> is <span class="XML-Token">NULL</span> or invalid.</li>
-<li><em>osErrorResource:</em> the mutex specified by parameter <em>mutex_id</em> is in an invalid mutex state or the mutex could not be obtained when no <em>timeout</em> was specified.</li>
<li><em>osErrorISR:</em> cannot be called from interrupt service routines.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>This function <b>cannot</b> be called from <a class="el" href="theory_of_operation.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl>
<p><b>Code Example</b> </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os2_8h.html">cmsis_os2.h</a>&quot;</span></div>
-<div class="line"> </div>
-<div class="line"><span class="keywordtype">void</span> WaitMutex (<span class="keywordtype">void</span>) {</div>
-<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id; </div>
-<div class="line">osStatus_t status;</div>
+<div class="line"> </div>
+<div class="line"><span class="keywordtype">void</span> WaitMutex (<span class="keywordtype">void</span>) {</div>
+<div class="line"> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id;</div>
+<div class="line"> osStatus_t status;</div>
<div class="line"> </div>
<div class="line"> mutex_id = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gab90920022ab944296821368ef6bb52f8">osMutexNew</a>(NULL);</div>
-<div class="line"> <span class="keywordflow">if</span> (mutex_id != NULL) {</div>
-<div class="line"> status = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gabc54686ea0fc281823b1763422d2a924">osMutexAcquire</a>(mutex_id, 0);</div>
+<div class="line"> <span class="keywordflow">if</span> (mutex_id != NULL) {</div>
+<div class="line"> status = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gabc54686ea0fc281823b1763422d2a924">osMutexAcquire</a>(mutex_id, 0U);</div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div>
<div class="line"> <span class="comment">// handle failure code</span></div>
<div class="line"> }</div>
@@ -543,19 +543,19 @@ size of provided memory for control block <p>The size (in bytes) of memory block
<p>Possible <a class="el" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> return values:</p>
<ul>
<li><em>osOK:</em> the mutex has been correctly released.</li>
+<li><em>osErrorResource:</em> the mutex could not be released (mutex was not acquired or running thread is not the owner).</li>
<li><em>osErrorParameter:</em> parameter <em>mutex_id</em> is <span class="XML-Token">NULL</span> or invalid.</li>
-<li><em>osErrorResource:</em> the mutex specified by parameter <em>mutex_id</em> is in an invalid mutex state or the mutex was not obtained before/the current thread is not the owner of the mutex.</li>
<li><em>osErrorISR:</em> <b>osMutexRelease</b> cannot be called from interrupt service routines.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>This function <b>cannot</b> be called from <a class="el" href="theory_of_operation.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl>
<p><b>Code Example</b> </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os2_8h.html">cmsis_os2.h</a>&quot;</span></div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id; <span class="comment">// Mutex id populated by the function osMutexNew()</span></div>
<div class="line"> </div>
-<div class="line"><span class="keywordtype">void</span> ReleaseMutex (<a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id) {</div>
+<div class="line"><span class="keywordtype">void</span> ReleaseMutex (<a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id) {</div>
<div class="line"> osStatus_t status;</div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (mutex_id != NULL) {</div>
<div class="line"> status = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gaea629705703580ff58776bf73c8db915">osMutexRelease</a>(mutex_id);</div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div>
@@ -616,18 +616,18 @@ size of provided memory for control block <p>The size (in bytes) of memory block
<ul>
<li><em>osOK:</em> the mutex object has been deleted.</li>
<li><em>osErrorParameter:</em> parameter <em>mutex_id</em> is <span class="XML-Token">NULL</span> or invalid.</li>
-<li><em>osErrorResource:</em> the mutex specified by parameter <em>mutex_id</em> is in an invalid mutex state.</li>
+<li><em>osErrorResource:</em> the mutex is in an invalid state.</li>
<li><em>osErrorISR:</em> <b>osMutexDelete</b> cannot be called from interrupt service routines.</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>This function <b>cannot</b> be called from <a class="el" href="theory_of_operation.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl>
<p><b>Code Example</b> </p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os2_8h.html">cmsis_os2.h</a>&quot;</span></div>
-<div class="line"> </div>
-<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id; <span class="comment">// Mutex id populated by the function osMutexNew()</span></div>
+<div class="line"> </div>
+<div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id; <span class="comment">// Mutex id populated by the function osMutexNew()</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> DeleteMutex (<a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a> mutex_id) {</div>
<div class="line"> osStatus_t status;</div>
-<div class="line"> </div>
+<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (mutex_id != NULL) {</div>
<div class="line"> status = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gabee73ad227ba4587d3db12ef9bd582bc">osMutexDelete</a>(mutex_id);</div>
<div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div>
@@ -643,7 +643,7 @@ size of provided memory for control block <p>The size (in bytes) of memory block
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
- <li class="footer">Generated on Wed Aug 1 2018 17:12:45 for CMSIS-RTOS2 by Arm Ltd. All rights reserved.
+ <li class="footer">Generated on Wed Jul 10 2019 15:21:04 for CMSIS-RTOS2 Version 2.1.3 by Arm Ltd. All rights reserved.
<!--
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6