📄 a00014.html
字号:
</dl><p>Definition at line <a class="el" href="a00022.html#l00246">246</a> of file <a class="el" href="a00022.html">pt.h</a>. </td> </tr></table><a class="anchor" name="ge6bae7dc0225468c8a5ac269df549892"></a><!-- doxytag: member="pt.h::PT_INIT" ref="ge6bae7dc0225468c8a5ac269df549892" args="(pt)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define PT_INIT </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="a00005.html">pt</a> </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Initialize a protothread. <p>Initializes a protothread. Initialization must be done prior to starting to execute the protothread.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pt</em> </td><td>A pointer to the protothread control structure.</td></tr> </table></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="a00014.html#g9e97a0b4d5cc7764d8e19758f5da53ae">PT_SPAWN()</a> </dd></dl><p>Definition at line <a class="el" href="a00022.html#l00080">80</a> of file <a class="el" href="a00022.html">pt.h</a>. </td> </tr></table><a class="anchor" name="gcd3ac045f0a4ae63412e3b3d8780e8ab"></a><!-- doxytag: member="pt.h::PT_RESTART" ref="gcd3ac045f0a4ae63412e3b3d8780e8ab" args="(pt)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define PT_RESTART </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="a00005.html">pt</a> </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Restart the protothread. <p>This macro will block and cause the running protothread to restart its execution at the place of the <a class="el" href="a00014.html#g2ffbb9e554e08a343ae2f9de4bedfdfc">PT_BEGIN()</a> call.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pt</em> </td><td>A pointer to the protothread control structure. </td></tr> </table></dl><p>Definition at line <a class="el" href="a00022.html#l00229">229</a> of file <a class="el" href="a00022.html">pt.h</a>. </td> </tr></table><a class="anchor" name="gfa82b860a64b67d25ab3abc21811896f"></a><!-- doxytag: member="pt.h::PT_SCHEDULE" ref="gfa82b860a64b67d25ab3abc21811896f" args="(f)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define PT_SCHEDULE </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">f </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Schedule a protothread. <p>This function shedules a protothread. The return value of the function is non-zero if the protothread is running or zero if the protothread has exited.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>f</em> </td><td>The call to the C function implementing the protothread to be scheduled </td></tr> </table></dl><p>Definition at line <a class="el" href="a00022.html#l00271">271</a> of file <a class="el" href="a00022.html">pt.h</a>. </td> </tr></table><a class="anchor" name="g9e97a0b4d5cc7764d8e19758f5da53ae"></a><!-- doxytag: member="pt.h::PT_SPAWN" ref="g9e97a0b4d5cc7764d8e19758f5da53ae" args="(pt, child, thread)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define PT_SPAWN </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="a00005.html">pt</a>, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>child, <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>thread </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Spawn a child protothread and wait until it exits. <p>This macro spawns a child protothread and waits until it exits. The macro can only be used within a protothread.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>pt</em> </td><td>A pointer to the protothread control structure. </td></tr> <tr><td valign="top"></td><td valign="top"><em>child</em> </td><td>A pointer to the child protothread's control structure. </td></tr> <tr><td valign="top"></td><td valign="top"><em>thread</em> </td><td>The child protothread with arguments </td></tr> </table></dl><p>Definition at line <a class="el" href="a00022.html#l00206">206</a> of file <a class="el" href="a00022.html">pt.h</a>. </td> </tr></table><a class="anchor" name="g3d4c8bd4aada659eb34f5d2ffd3e7901"></a><!-- doxytag: member="pt.h::PT_THREAD" ref="g3d4c8bd4aada659eb34f5d2ffd3e7901" args="(name_args)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">#define PT_THREAD </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">name_args </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Declaration of a protothread. <p>This macro is used to declare a protothread. All protothreads must be declared with this macro.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>name_args</em> </td><td>The name and arguments of the C function implementing the protothread. </td></tr> </table></dl><p>Definition at line <a class="el" href="a00022.html#l00100">100</a> of file <a class="el" href="a00022.html">pt.h</a>. </td> </tr></table><a class="anchor" name="g2f8f70c30b9ee08a103fbd69a4365c4c"></a><!-- doxytag: member="pt.h::PT_WAIT_THREAD" ref="g2f8f70c30b9ee08a103fbd69a4365c4c" args="(pt, thread)" --><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -