<?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>Defining a thread with a K_FOREVER dealy will cause a compile error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84404/defining-a-thread-with-a-k_forever-dealy-will-cause-a-compile-error</link><description>According to Zephyr documentation it is possible to define a thread with K_FOREVER delay so it will not start till k_thread_start is called 
 https://developer.nordicsemi.com/nRF_Connect_SDK/doc/0.3.0/zephyr/api/kernel_api.html?highlight=k_thread_start#_CPPv314k_thread_start7k_tid_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Feb 2022 12:00:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84404/defining-a-thread-with-a-k_forever-dealy-will-cause-a-compile-error" /><item><title>RE: Defining a thread with a K_FOREVER dealy will cause a compile error</title><link>https://devzone.nordicsemi.com/thread/351314?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 12:00:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2d1abc5-581d-4694-b747-a2f43f606e7e</guid><dc:creator>Ignacio</dc:creator><description>&lt;p&gt;That works. Although latest Nordic documentation shows the same for&amp;nbsp;&lt;span&gt;k_thread_start&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/kernel/threads/index.html?highlight=k_thread_start#c.k_thread_start"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/kernel/threads/index.html?highlight=k_thread_start#c.k_thread_start&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Zephyr latest version and 2.7.0 show the same info&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/2.7.0/reference/kernel/threads/index.html?highlight=k_thread_start#c.k_thread_start"&gt;https://docs.zephyrproject.org/2.7.0/reference/kernel/threads/index.html?highlight=k_thread_start#c.k_thread_start&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thus, it is my opinion that using K_FOREVER on the thread definition is the correct implementation. Setting value as &amp;quot;-1&amp;quot; should be a temporary workaround.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Defining a thread with a K_FOREVER dealy will cause a compile error</title><link>https://devzone.nordicsemi.com/thread/351305?ContentTypeID=1</link><pubDate>Fri, 04 Feb 2022 11:43:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f087c93-65ce-4ed5-9e34-b4c2f69ab93a</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You are viewing older documentation.&amp;nbsp;The define itself takes in a int type, while the K_FOREVER is a type k_timeout_t.&lt;/p&gt;
&lt;p&gt;Could you try providing &amp;quot;-1&amp;quot; as the delay? Similar to how its done here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.0-ncs1/samples/drivers/espi/src/espi_oob_handler.c#L28-L38"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.7.0-ncs1/samples/drivers/espi/src/espi_oob_handler.c#L28-L38&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>