<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to handle a NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72437/how-to-handle-a-nrf_error_soc_mutex_already_taken-error</link><description>I should not be asking this question here but it should be documented! SoftDevice s130. 
 A possible error I can get when executing sd_mutex_acquire() is NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN . However, I have no idea what I should do now. Nothing in the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Mar 2021 14:07:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72437/how-to-handle-a-nrf_error_soc_mutex_already_taken-error" /><item><title>RE: How to handle a NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN error</title><link>https://devzone.nordicsemi.com/thread/298417?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 14:07:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:debebc86-af3a-4e9a-a457-71c4dbc3c71a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Yes. I agree with you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle a NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN error</title><link>https://devzone.nordicsemi.com/thread/298386?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 13:18:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a914fae-9270-4afb-9820-349ab1f4c4ae</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Amanda, my understanding is that nrf_delay_us() is nothing but a busy loop that tags the CPU. Would there be any advantage to calling a busy loop over just a while loop on the &lt;span&gt;sd_mutex_acquire&amp;nbsp;&lt;/span&gt;method itself? At least when one calls the&amp;nbsp;&lt;span&gt;sd_mutex_acquire&lt;/span&gt; method over and over again there is no unnecessary delay when the method succeeds.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle a NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN error</title><link>https://devzone.nordicsemi.com/thread/298364?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 12:40:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4403a56c-e4aa-4ccf-9de4-621b3d4f8cc1</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Wait with delay like this:&lt;/p&gt;
&lt;p&gt;while (sd_mutex_acquire(&amp;amp;m_mutex) == NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN)&lt;br /&gt; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;nrf_delay_us(1000);&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;-Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>