<ahref="chthreads_8h.html">Go to the documentation of this file.</a><divclass="fragment"><preclass="fragment"><aname="l00001"></a>00001 <spanclass="comment">/*</span>
<aname="l00056"></a><aclass="code"href="struct_thread.html">00056</a><spanclass="keyword">struct </span><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> {
<aname="l00057"></a><aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1">00057</a><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="struct_thread.html#a49d3270919a6e423a47de20bc57beaa1"title="Next in the list/queue.">p_next</a>; <spanclass="comment">/**< @brief Next in the list/queue. */</span>
<aname="l00058"></a>00058 <spanclass="comment">/* End of the fields shared with the ThreadsList structure. */</span>
<aname="l00059"></a><aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69">00059</a><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="struct_thread.html#a7661cf39bbb29453ce0c48a94708fb69"title="Previous in the queue.">p_prev</a>; <spanclass="comment">/**< @brief Previous in the queue. */</span>
<aname="l00060"></a>00060 <spanclass="comment">/* End of the fields shared with the ThreadsQueue structure. */</span>
<aname="l00061"></a><aclass="code"href="struct_thread.html#ae60cc22956f4c19965cb94045333aa9c">00061</a><aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a><aclass="code"href="struct_thread.html#ae60cc22956f4c19965cb94045333aa9c"title="Thread priority.">p_prio</a>; <spanclass="comment">/**< @brief Thread priority. */</span>
<aname="l00062"></a><aclass="code"href="struct_thread.html#afd8825ffa1551fff7a1fe636d437408c">00062</a><spanclass="keyword">struct </span><aclass="code"href="structcontext.html"title="Platform dependent part of the Thread structure.">context</a><aclass="code"href="struct_thread.html#afd8825ffa1551fff7a1fe636d437408c"title="Processor context.">p_ctx</a>; <spanclass="comment">/**< @brief Processor context. */</span>
<aname="l00067"></a>00067 <spanclass="preprocessor"></span><spanclass="comment">/* End of the fields shared with the ReadyList structure. */</span><spanclass="comment"></span>
<aname="l00080"></a><aclass="code"href="struct_thread.html#af86d1da435197d113bc42fe8139a21c5">00080</a><aclass="code"href="group__types.html#ga205898ea166481281fec650f2a7e85a3"title="Thread references counter, uint8_t is ok.">trefs_t</a><aclass="code"href="struct_thread.html#af86d1da435197d113bc42fe8139a21c5"title="References to this thread.">p_refs</a>;
<aname="l00093"></a><aclass="code"href="struct_thread.html#a723aab9bf515e789c3d9ea81f9dbd6a0">00093</a><spanclass="keyword">volatile</span><aclass="code"href="group__types.html#gae3e32a98d431a02106616da3071832dd"title="System Time, recommended fastest unsigned.">systime_t</a><aclass="code"href="struct_thread.html#a723aab9bf515e789c3d9ea81f9dbd6a0"title="Thread consumed time in ticks.">p_time</a>;
<aname="l00107"></a><aclass="code"href="struct_thread.html#ad5792c30fbd60df0de223b0f398fc6d7">00107</a><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a><aclass="code"href="struct_thread.html#ad5792c30fbd60df0de223b0f398fc6d7"title="Thread wakeup code.">rdymsg</a>;<spanclass="comment"></span>
<aname="l00114"></a><aclass="code"href="struct_thread.html#addbf4614b204bdc2a3480c434cf7baaf">00114</a><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a><aclass="code"href="struct_thread.html#addbf4614b204bdc2a3480c434cf7baaf"title="Thread exit code.">exitcode</a>;<spanclass="comment"></span>
<aname="l00121"></a><aclass="code"href="struct_thread.html#a4f016b01444741e6f9b420436b748862">00121</a><spanclass="keywordtype">void</span> *<aclass="code"href="struct_thread.html#a4f016b01444741e6f9b420436b748862"title="Pointer to a generic &quot;wait&quot; object.">wtobjp</a>;
<aname="l00135"></a><aclass="code"href="struct_thread.html#ad1088bc1f9970cc102dc28000134e9ab">00135</a><aclass="code"href="struct_threads_list.html"title="Generic threads single link list, it works like a stack.">ThreadsList</a><aclass="code"href="struct_thread.html#ad1088bc1f9970cc102dc28000134e9ab"title="Termination waiting list.">p_waiting</a>;
<aname="l00141"></a><aclass="code"href="struct_thread.html#a282cb59bdbe00fcdf9741c47b735fa1f">00141</a><aclass="code"href="struct_threads_queue.html"title="Generic threads bidirectional linked list header and element.">ThreadsQueue</a><aclass="code"href="struct_thread.html#a282cb59bdbe00fcdf9741c47b735fa1f"title="Messages queue.">p_msgqueue</a>;<spanclass="comment"></span>
<aname="l00145"></a><aclass="code"href="struct_thread.html#a8651bb33a6947efd9061c035ca0b728f">00145</a><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a><aclass="code"href="struct_thread.html#a8651bb33a6947efd9061c035ca0b728f"title="Thread message.">p_msg</a>;
<aname="l00158"></a><aclass="code"href="struct_thread.html#a3ae80b4b3de4c7a23c542ca251e1f017">00158</a><aclass="code"href="struct_mutex.html"title="Mutex structure.">Mutex</a> *<aclass="code"href="struct_thread.html#a3ae80b4b3de4c7a23c542ca251e1f017"title="List of the mutexes owned by this thread.">p_mtxlist</a>;<spanclass="comment"></span>
<aname="l00162"></a><aclass="code"href="struct_thread.html#a38de11dd7f8cdcfbc45b2c467f400fe8">00162</a><aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a><aclass="code"href="struct_thread.html#a38de11dd7f8cdcfbc45b2c467f400fe8"title="Thread&#39;s own, non-inherited, priority.">p_realprio</a>;
<aname="l00168"></a><aclass="code"href="struct_thread.html#ae0e65912a0c02df5477a3a524cd41d97">00168</a><spanclass="keywordtype">void</span> *<aclass="code"href="struct_thread.html#ae0e65912a0c02df5477a3a524cd41d97"title="Memory Pool where the thread workspace is returned.">p_mpool</a>;
<aname="l00211"></a><aclass="code"href="group__threads.html#gabfe59aa7d2ed1b8e57a2ce17bcbc1189">00211</a><spanclass="keyword">typedef</span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> (*<aclass="code"href="group__threads.html#gabfe59aa7d2ed1b8e57a2ce17bcbc1189"title="Thread function.">tfunc_t</a>)(<spanclass="keywordtype">void</span> *);
<aname="l00219"></a>00219 <spanclass="preprocessor"></span><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__threads.html#ga4f6ae58bb3cedfc03aacde6d49e49d35"title="Initializes a thread structure.">init_thread</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp, <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio);
<aname="l00220"></a>00220 <aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__threads.html#gac6de13d4044b32d3ae9e2066b5d4c030"title="Creates a new thread into a static memory area.">chThdCreateI</a>(<spanclass="keywordtype">void</span> *wsp, <spanclass="keywordtype">size_t</span> size,
<aname="l00221"></a>00221 <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio, <aclass="code"href="group__threads.html#gabfe59aa7d2ed1b8e57a2ce17bcbc1189"title="Thread function.">tfunc_t</a> pf, <spanclass="keywordtype">void</span> *arg);
<aname="l00222"></a>00222 <aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__threads.html#ga048e588238dd336c6059133b3d0c3435"title="Creates a new thread into a static memory area.">chThdCreateStatic</a>(<spanclass="keywordtype">void</span> *wsp, <spanclass="keywordtype">size_t</span> size,
<aname="l00223"></a>00223 <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio, <aclass="code"href="group__threads.html#gabfe59aa7d2ed1b8e57a2ce17bcbc1189"title="Thread function.">tfunc_t</a> pf, <spanclass="keywordtype">void</span> *arg);
<aname="l00225"></a>00225 <spanclass="preprocessor"></span><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__threads.html#ga50b84e3e82a4e09c1066e1d422e4c780"title="Creates a new thread allocating the memory from the heap.">chThdCreateFromHeap</a>(<aclass="code"href="structmemory__heap.html"title="Structure describing a memory heap.">MemoryHeap</a> *heapp, <spanclass="keywordtype">size_t</span> size,
<aname="l00226"></a>00226 <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio, <aclass="code"href="group__threads.html#gabfe59aa7d2ed1b8e57a2ce17bcbc1189"title="Thread function.">tfunc_t</a> pf, <spanclass="keywordtype">void</span> *arg);
<aname="l00229"></a>00229 <spanclass="preprocessor"></span><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__threads.html#gad3ccc1a6f054c543258ed2fe97ed2f58"title="Creates a new thread allocating the memory from the specified memory pool.">chThdCreateFromMemoryPool</a>(<aclass="code"href="struct_memory_pool.html"title="Memory pool descriptor.">MemoryPool</a> *mp, <aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> prio,
<aname="l00232"></a>00232 <spanclass="preprocessor"></span><aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a><aclass="code"href="group__threads.html#ga5a5d9388c64e4c1a3aec129d2831eefe"title="Changes the running thread priority level then reschedules if necessary.">chThdSetPriority</a>(<aclass="code"href="group__types.html#ga5f2488ba73e5969cbc0f7033735374ee"title="Priority, use the fastest unsigned type.">tprio_t</a> newprio);
<aname="l00233"></a>00233 <aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__threads.html#ga2c1ce2be73cd177af7e577b282232a7d"title="Resumes a suspended thread.">chThdResume</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp);
<aname="l00234"></a>00234 <spanclass="keywordtype">void</span><aclass="code"href="group__threads.html#ga7ea7371fa41598ebd523622587ce3f22"title="Requests a thread termination.">chThdTerminate</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp);
<aname="l00235"></a>00235 <spanclass="keywordtype">void</span><aclass="code"href="group__threads.html#ga8b10a49e2ec522a5ddecabdc453afcab"title="Suspends the invoking thread for the specified time.">chThdSleep</a>(<aclass="code"href="group__types.html#gae3e32a98d431a02106616da3071832dd"title="System Time, recommended fastest unsigned.">systime_t</a> time);
<aname="l00236"></a>00236 <spanclass="keywordtype">void</span><aclass="code"href="group__threads.html#ga9e6e2f8d46d415e8f0862daf0be1d984"title="Suspends the invoking thread until the system time arrives to the specified value.">chThdSleepUntil</a>(<aclass="code"href="group__types.html#gae3e32a98d431a02106616da3071832dd"title="System Time, recommended fastest unsigned.">systime_t</a> time);
<aname="l00237"></a>00237 <spanclass="keywordtype">void</span><aclass="code"href="group__threads.html#gacb0a8f22a8358487eaebab3c84b1c4a1"title="Yields the time slot.">chThdYield</a>(<spanclass="keywordtype">void</span>);
<aname="l00238"></a>00238 <spanclass="keywordtype">void</span><aclass="code"href="group__threads.html#ga24ab3a3a4d70214ee360867a1c3c75ac"title="Terminates the current thread by specifying an exit status code.">chThdExit</a>(<aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a> msg);
<aname="l00240"></a>00240 <spanclass="preprocessor"></span><aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *<aclass="code"href="group__threads.html#gabefc5734beaf29ae0bcd52cd41744930"title="Adds a reference to a thread object.">chThdAddRef</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp);
<aname="l00241"></a>00241 <spanclass="keywordtype">void</span><aclass="code"href="group__threads.html#gaa22f80040cf192015be4607f31a0ac80"title="Releases a reference to a thread object.">chThdRelease</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp);
<aname="l00244"></a>00244 <spanclass="preprocessor"></span><aclass="code"href="group__types.html#ga35bcb0c321cd7bc45bf1a11fa17ebdd3"title="Message, use signed pointer equivalent.">msg_t</a><aclass="code"href="group__threads.html#ga94a5727ecdbe0f738dfc8e1ede1c3409"title="Blocks the execution of the invoking thread until the specified thread terminates then the exit code ...">chThdWait</a>(<aclass="code"href="struct_thread.html"title="Structure representing a thread.">Thread</a> *tp);
<aname="l00280"></a><aclass="code"href="group__threads.html#ga5591a9f97ff77b40bd5fc29f16f12a6b">00280</a><spanclass="preprocessor">#define chThdShouldTerminate() (currp->p_flags & THD_TERMINATE)</span>
Generated on Sun Oct 24 2010 09:40:37 for ChibiOS/RT by <ahref="http://www.doxygen.org/index.html"><imgsrc="doxygen.png"alt="doxygen"align="middle"border="0"></a> 1.7.1</small></address>