<?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 delete semaphore</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/86429/how-delete-semaphore</link><description>Hi, 
 I use event manager and define semaphore according to https://docs.zephyrproject.org/latest/reference/kernel/synchronization/semaphores.html . How can i delete the semaphore at runtime and define new one? Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Apr 2022 06:50:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/86429/how-delete-semaphore" /><item><title>RE: How delete semaphore</title><link>https://devzone.nordicsemi.com/thread/361391?ContentTypeID=1</link><pubDate>Mon, 04 Apr 2022 06:50:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3037dcaf-d3f1-4a56-8903-5cfe683db6e1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;So this is not from Zephyr, right? It is a separate library?&lt;/p&gt;
&lt;p&gt;Again, if it works, then I see no reason why you can&amp;#39;t use it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How delete semaphore</title><link>https://devzone.nordicsemi.com/thread/361362?ContentTypeID=1</link><pubDate>Sun, 03 Apr 2022 07:27:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:250e60d4-8768-41de-adfe-655de803b0e1</guid><dc:creator>MaximSh</dc:creator><description>&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;span&gt;Hi ,from v2 API&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;#include&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&amp;lt;cmsis_os2.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span&gt;&lt;br /&gt;osSemaphoreNew - Create&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span&gt;&lt;span&gt;&lt;span&gt;osSemaphoreAcquire - Take&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;osSemaphoreRelease - Give&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;osSemaphoreDelete - Delete&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How delete semaphore</title><link>https://devzone.nordicsemi.com/thread/361134?ContentTypeID=1</link><pubDate>Fri, 01 Apr 2022 06:50:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa2b5410-2b0d-4317-9b7a-5d8f25a62d16</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Well, if it works, I guess it does. What API did you use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How delete semaphore</title><link>https://devzone.nordicsemi.com/thread/361068?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2022 14:06:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da38b1f3-01db-40cf-85f1-e52b73489e1d</guid><dc:creator>MaximSh</dc:creator><description>&lt;p&gt;The ne is not equals to old.&lt;br /&gt;I found that cmsis v2&amp;nbsp; lib can add and delete semaphore, what do you think?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How delete semaphore</title><link>https://devzone.nordicsemi.com/thread/361067?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2022 14:06:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b2f4b00-a735-47cf-8ff3-e07326b61efd</guid><dc:creator>MaximSh</dc:creator><description>&lt;p&gt;The ne is not equals to old.&lt;br /&gt;I found that cmsis v2&amp;nbsp; lib can add and delete semaphore, what do you think?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How delete semaphore</title><link>https://devzone.nordicsemi.com/thread/361043?ContentTypeID=1</link><pubDate>Thu, 31 Mar 2022 13:03:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b25d0db2-8c5b-4352-9902-10d17dc4c66f</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think there is any API to delete a semaphore. If you want to do this, you will need to add this functionality to the semaphore implementation, but if you do this, it means that you need to change some zephyr files, which means you will need to do this again every time you update the SDK, which is not ideal.&lt;/p&gt;
&lt;p&gt;Why do you need to delete it and define a new one? Is the new one equal to the old one? If so, perhaps you can just use &lt;a href="https://docs.zephyrproject.org/latest/reference/kernel/synchronization/semaphores.html#c.k_sem_reset"&gt;k_sem_reset()&lt;/a&gt; instead?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>