mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
Add task_testcancel()
This commit is contained in:
@@ -205,50 +205,51 @@ paragraphs.
|
||||
<li><a href="#taskrestart">2.1.5 task_restart</a></li>
|
||||
<li><a href="#tasksetcancelstate">2.1.6 task_setcancelstate</a></li>
|
||||
<li><a href="#tasksetcanceltype">2.1.7 task_setcanceltype</a></li>
|
||||
<li><a href="#tasktestcancel">2.1.8 task_testcancel</a></li>
|
||||
</ul>
|
||||
<p>
|
||||
Standard interfaces
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="#exit">2.1.8 exit</a></li>
|
||||
<li><a href="#getpid">2.1.9 getpid</a></li>
|
||||
<li><a href="#exit">2.1.9 exit</a></li>
|
||||
<li><a href="#getpid">2.1.10 getpid</a></li>
|
||||
</ul>
|
||||
<p>
|
||||
Standard <code>vfork</code> and <code>exec[v|l]</code> interfaces:
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="#vfork">2.1.10 vfork</a></li>
|
||||
<li><a href="#execv">2.1.11 execv</a></li>
|
||||
<li><a href="#execl">2.1.12 execl</a></li>
|
||||
<li><a href="#vfork">2.1.11 vfork</a></li>
|
||||
<li><a href="#execv">2.1.12 execv</a></li>
|
||||
<li><a href="#execl">2.1.13 execl</a></li>
|
||||
</ul>
|
||||
<p>
|
||||
Standard <code>posix_spawn</code> interfaces:
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="#posix_spawn">2.1.13 posix_spawn and posix_spawnp</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_init">2.1.14 posix_spawn_file_actions_init</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_destroy">2.1.15 posix_spawn_file_actions_destroy</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_addclose">2.1.16 posix_spawn_file_actions_addclose</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_adddup2">2.1.17 posix_spawn_file_actions_adddup2</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_addopen">2.1.18 posix_spawn_file_actions_addopen</a></li>
|
||||
<li><a href="#posix_spawnattr_init">2.1.19 posix_spawnattr_init</a></li>
|
||||
<li><a href="#posix_spawnattr_getflags">2.1.20 posix_spawnattr_getflags</a></li>
|
||||
<li><a href="#posix_spawnattr_getschedparam">2.1.21 posix_spawnattr_getschedparam</a></li>
|
||||
<li><a href="#posix_spawnattr_getschedpolicy">2.1.22 posix_spawnattr_getschedpolicy</a></li>
|
||||
<li><a href="#posix_spawnattr_getsigmask">2.1.23 posix_spawnattr_getsigmask</a></li>
|
||||
<li><a href="#posix_spawnattr_setflags">2.1.24 posix_spawnattr_setflags</a></li>
|
||||
<li><a href="#posix_spawnattr_setschedparam">2.1.25 posix_spawnattr_setschedparam</a></li>
|
||||
<li><a href="#posix_spawnattr_setschedpolicy">2.1.26 posix_spawnattr_setschedpolicy</a></li>
|
||||
<li><a href="#posix_spawnattr_setsigmask">2.1.27 posix_spawnattr_setsigmask</a></li>
|
||||
<li><a href="#posix_spawn">2.1.14 posix_spawn and posix_spawnp</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_init">2.1.15 posix_spawn_file_actions_init</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_destroy">2.1.16 posix_spawn_file_actions_destroy</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_addclose">2.1.17 posix_spawn_file_actions_addclose</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_adddup2">2.1.18 posix_spawn_file_actions_adddup2</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_addopen">2.1.19 posix_spawn_file_actions_addopen</a></li>
|
||||
<li><a href="#posix_spawnattr_init">2.1.20 posix_spawnattr_init</a></li>
|
||||
<li><a href="#posix_spawnattr_getflags">2.1.21 posix_spawnattr_getflags</a></li>
|
||||
<li><a href="#posix_spawnattr_getschedparam">2.1.22 posix_spawnattr_getschedparam</a></li>
|
||||
<li><a href="#posix_spawnattr_getschedpolicy">2.1.23 posix_spawnattr_getschedpolicy</a></li>
|
||||
<li><a href="#posix_spawnattr_getsigmask">2.1.24 posix_spawnattr_getsigmask</a></li>
|
||||
<li><a href="#posix_spawnattr_setflags">2.1.25 posix_spawnattr_setflags</a></li>
|
||||
<li><a href="#posix_spawnattr_setschedparam">2.1.26 posix_spawnattr_setschedparam</a></li>
|
||||
<li><a href="#posix_spawnattr_setschedpolicy">2.1.27 posix_spawnattr_setschedpolicy</a></li>
|
||||
<li><a href="#posix_spawnattr_setsigmask">2.1.28 posix_spawnattr_setsigmask</a></li>
|
||||
</ul>
|
||||
<p>
|
||||
Non-standard task control interfaces inspired by <code>posix_spawn</code>:
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="#task_spawn">2.1.28 task_spawn</a></li>
|
||||
<li><a href="#task_spawnattr_getstacksize">2.1.29 task_spawnattr_getstacksize</a></li>
|
||||
<li><a href="#task_spawnattr_setstacksize">2.1.30 task_spawnattr_setstacksize</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_init">2.1.31 posix_spawn_file_actions_init</a></li>
|
||||
<li><a href="#task_spawn">2.1.29 task_spawn</a></li>
|
||||
<li><a href="#task_spawnattr_getstacksize">2.1.30 task_spawnattr_getstacksize</a></li>
|
||||
<li><a href="#task_spawnattr_setstacksize">2.1.31 task_spawnattr_setstacksize</a></li>
|
||||
<li><a href="#posix_spawn_file_actions_init">2.1.32 posix_spawn_file_actions_init</a></li>
|
||||
</ul>
|
||||
|
||||
<H3><a name="taskcreate">2.1.1 task_create</a></H3>
|
||||
@@ -647,7 +648,7 @@ No thread could be found corresponding to that specified by the given thread ID.
|
||||
</p>
|
||||
<b>Assumptions/Limitations:</b>
|
||||
<p>
|
||||
<b>POSIX Compatibility:</b> This is a non-standard interface. It extends the functionality of <code>pthread_setcancelstate()</code> to tasks and supports use of <code>task_delete</code>.
|
||||
<b>POSIX Compatibility:</b> This is a non-standard interface. It extends the functionality of <code>pthread_setcancelstate()</code> to tasks and supports use of <code>task_delete()</code>.
|
||||
</p>
|
||||
|
||||
<H3><a name="tasksetcanceltype">2.1.7 task_setcanceltype</a></H3>
|
||||
@@ -690,10 +691,38 @@ No thread could be found corresponding to that specified by the given thread ID.
|
||||
</ul>
|
||||
</p>
|
||||
<p>
|
||||
<b>POSIX Compatibility:</b> This is a non-standard interface. It extends the functionality of <code>pthread_setcanceltype()</code> to tasks and supports use of <code>task_delete</code>.
|
||||
<b>POSIX Compatibility:</b> This is a non-standard interface. It extends the functionality of <code>pthread_setcanceltype()</code> to tasks and supports use of <code>task_delete()</code>.
|
||||
</p>
|
||||
|
||||
<H3><a name="exit">2.1.8 exit</a></H3>
|
||||
<H3><a name="tasktestcancel">2.1.8 task_testcancel</a></H3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
<p>
|
||||
<pre>
|
||||
#include <sched.h>
|
||||
void task_testcancel(void);
|
||||
</pre>
|
||||
</p>
|
||||
<p>
|
||||
<b>Description:</b>
|
||||
</p>
|
||||
<p>
|
||||
The <code>task_testcancel()</code> function creates a cancellation point in the calling task.
|
||||
The <code>task_testcancel()</code> function has no effect if cancelability is disabled.
|
||||
</p>
|
||||
<p>
|
||||
<b>Input Parameters:</b> None
|
||||
</p>
|
||||
<p>
|
||||
<b>Returned Value:</b> None
|
||||
</p>
|
||||
<p>
|
||||
<b>POSIX Compatibility:</b> This is a non-standard interface. It extends the functionality of <code>pthread_testcancel()</code> to tasks and supports use of <code>task_delete()</code>.
|
||||
</p>
|
||||
|
||||
|
||||
<H3><a name="exit">2.1.9 exit</a></H3>
|
||||
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
@@ -739,7 +768,7 @@ And the UNIX interface:
|
||||
<li>The <code>code</code> parameter is ignored.
|
||||
</ul>
|
||||
|
||||
<H3><a name="getpid">2.1.9 getpid</a></H3>
|
||||
<H3><a name="getpid">2.1.10 getpid</a></H3>
|
||||
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
@@ -767,7 +796,7 @@ level.
|
||||
Compatible with the POSIX interface of the same name.
|
||||
</p>
|
||||
|
||||
<H3><a name="vfork">2.1.10 vfork</a></H3>
|
||||
<H3><a name="vfork">2.1.11 vfork</a></H3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -801,7 +830,7 @@ pid_t vfork(void);
|
||||
Compatible with the Unix interface of the same name.
|
||||
</p>
|
||||
|
||||
<H3><a name="execv">2.1.11 execv</a></H3>
|
||||
<H3><a name="execv">2.1.12 execv</a></H3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -887,7 +916,7 @@ int execv(FAR const char *path, FAR char *const argv[]);
|
||||
There are, however, several compatibility issues as detailed in the description above.
|
||||
</p>
|
||||
|
||||
<H3><a name="execl">2.1.12 execl</a></H3>
|
||||
<H3><a name="execl">2.1.13 execl</a></H3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -931,7 +960,7 @@ int execl(FAR const char *path, ...);
|
||||
There are, however, several compatibility issues as detailed in the description of <a href="#execv">execv()</a>.
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawn">2.1.13 posix_spawn and posix_spawnp</a></h3>
|
||||
<h3><a name="posix_spawn">2.1.14 posix_spawn and posix_spawnp</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1074,7 +1103,7 @@ int posix_spawnp(FAR pid_t *pid, FAR const char *file,
|
||||
For the caller of <code>posix_spawn()</code>, the provided argv[0] will correspond to <code>argv[1]</code> received by the new task.
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawn_file_actions_init">2.1.14 posix_spawn_file_actions_init</a></h3>
|
||||
<h3><a name="posix_spawn_file_actions_init">2.1.15 posix_spawn_file_actions_init</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1100,7 +1129,7 @@ int posix_spawn_file_actions_init(FAR posix_spawn_file_actions_t *file_actions);
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>.
|
||||
<p>
|
||||
|
||||
<h3><a name="posix_spawn_file_actions_destroy">2.1.15 posix_spawn_file_actions_destroy</a></h3>
|
||||
<h3><a name="posix_spawn_file_actions_destroy">2.1.16 posix_spawn_file_actions_destroy</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1127,7 +1156,7 @@ int posix_spawn_file_actions_destroy(FAR posix_spawn_file_actions_t *file_action
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
<p>
|
||||
|
||||
<h3><a name="posix_spawn_file_actions_addclose">2.1.16 posix_spawn_file_actions_addclose</a></h3>
|
||||
<h3><a name="posix_spawn_file_actions_addclose">2.1.17 posix_spawn_file_actions_addclose</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1158,7 +1187,7 @@ int posix_spawn_file_actions_addclose(FAR posix_spawn_file_actions_t *file_actio
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawn_file_actions_adddup2">2.1.17 posix_spawn_file_actions_adddup2</a></h3>
|
||||
<h3><a name="posix_spawn_file_actions_adddup2">2.1.18 posix_spawn_file_actions_adddup2</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1195,7 +1224,7 @@ int posix_spawn_file_actions_adddup2(FAR posix_spawn_file_actions_t *file_action
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawn_file_actions_addopen">2.1.18 posix_spawn_file_actions_addopen</a></h3>
|
||||
<h3><a name="posix_spawn_file_actions_addopen">2.1.19 posix_spawn_file_actions_addopen</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1240,7 +1269,7 @@ int posix_spawn_file_actions_addopen(FAR posix_spawn_file_actions_t *file_action
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawnattr_init">2.1.19 posix_spawnattr_init</a></h3>
|
||||
<h3><a name="posix_spawnattr_init">2.1.20 posix_spawnattr_init</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1276,7 +1305,7 @@ int posix_spawnattr_init(FAR posix_spawnattr_t *attr);
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawnattr_getflags">2.1.20 posix_spawnattr_getflags</a></h3>
|
||||
<h3><a name="posix_spawnattr_getflags">2.1.21 posix_spawnattr_getflags</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1306,7 +1335,7 @@ int posix_spawnattr_getflags(FAR const posix_spawnattr_t *attr, FAR short *flags
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawnattr_getschedparam">2.1.21 posix_spawnattr_getschedparam</a></h3>
|
||||
<h3><a name="posix_spawnattr_getschedparam">2.1.22 posix_spawnattr_getschedparam</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1336,7 +1365,7 @@ int posix_spawnattr_getschedparam(FAR const posix_spawnattr_t *attr, FAR struct
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawnattr_getschedpolicy">2.1.22 posix_spawnattr_getschedpolicy</a></h3>
|
||||
<h3><a name="posix_spawnattr_getschedpolicy">2.1.23 posix_spawnattr_getschedpolicy</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1366,7 +1395,7 @@ int posix_spawnattr_getschedpolicy(FAR const posix_spawnattr_t *attr, FAR int *p
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawnattr_getsigmask">2.1.23 posix_spawnattr_getsigmask</a></h3>
|
||||
<h3><a name="posix_spawnattr_getsigmask">2.1.24 posix_spawnattr_getsigmask</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1398,7 +1427,7 @@ int posix_spawnattr_getsigmask(FAR const posix_spawnattr_t *attr, FAR sigset_t *
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawnattr_setflags">2.1.24 posix_spawnattr_setflags</a></h3>
|
||||
<h3><a name="posix_spawnattr_setflags">2.1.25 posix_spawnattr_setflags</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1428,7 +1457,7 @@ int posix_spawnattr_setflags(FAR posix_spawnattr_t *attr, short flags);
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawnattr_setschedparam">2.1.25 posix_spawnattr_setschedparam</a></h3>
|
||||
<h3><a name="posix_spawnattr_setschedparam">2.1.26 posix_spawnattr_setschedparam</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1458,7 +1487,7 @@ int posix_spawnattr_setschedparam(FAR posix_spawnattr_t *attr, FAR const struct
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawnattr_setschedpolicy">2.1.26 posix_spawnattr_setschedpolicy</a></h3>
|
||||
<h3><a name="posix_spawnattr_setschedpolicy">2.1.27 posix_spawnattr_setschedpolicy</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1488,7 +1517,7 @@ int posix_spawnattr_setschedpolicy(FAR posix_spawnattr_t *attr, int policy);
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawnattr_setsigmask">2.1.27 posix_spawnattr_setsigmask</a></h3>
|
||||
<h3><a name="posix_spawnattr_setsigmask">2.1.28 posix_spawnattr_setsigmask</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1520,7 +1549,7 @@ int posix_spawnattr_setsigmask(FAR posix_spawnattr_t *attr, FAR const sigset_t *
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="task_spawn">2.1.28 task_spawn</a></h3>
|
||||
<h3><a name="task_spawn">2.1.29 task_spawn</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1634,7 +1663,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry,
|
||||
This is a non-standard interface inspired by <code>posix_spawn()</code>.
|
||||
</p>
|
||||
|
||||
<h3><a name="task_spawnattr_getstacksize">2.1.29 task_spawnattr_getstacksize</a></h3>
|
||||
<h3><a name="task_spawnattr_getstacksize">2.1.30 task_spawnattr_getstacksize</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1664,7 +1693,7 @@ int task_spawnattr_getstacksize(FAR const posix_spawnattr_t *attr, FAR size_t *s
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="task_spawnattr_setstacksize">2.1.30 task_spawnattr_setstacksize</a></h3>
|
||||
<h3><a name="task_spawnattr_setstacksize">2.1.31 task_spawnattr_setstacksize</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -1694,7 +1723,7 @@ int task_spawnattr_setstacksize(FAR posix_spawnattr_t *attr, size_t stacksize);
|
||||
On success, this function returns 0; on failure it will return an error number from <code><errno.h></code>
|
||||
</p>
|
||||
|
||||
<h3><a name="posix_spawn_file_actions_init">2.1.31 posix_spawn_file_actions_init</a></h3>
|
||||
<h3><a name="posix_spawn_file_actions_init">2.1.32 posix_spawn_file_actions_init</a></h3>
|
||||
<p>
|
||||
<b>Function Prototype:</b>
|
||||
</p>
|
||||
@@ -10370,6 +10399,7 @@ notify a task when a message is available on a queue.
|
||||
<li><a href="#task_spawnattr_getstacksize">task_spawnattr_getstacksize</a></li>
|
||||
<li><a href="#task_spawnattr_setstacksize">task_spawnattr_setstacksize</a></li>
|
||||
<li><a href="#Task_Switch">Task Switching Interfaces</a>
|
||||
<li><a href="#tasktestcancel">task_testcancel</a></li>
|
||||
<li><a href="#dirdirentops">telldir</a></li>
|
||||
<li><a href="#timercreate">timer_create</a></li>
|
||||
<li><a href="#timerdelete">timer_delete</a></li>
|
||||
|
||||
Reference in New Issue
Block a user