summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-28 10:29:49 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-04 11:05:26 +0200
commit6a20bd2f4f92d39afd06fc0746fd3e8a74b75513 (patch)
tree14c04103fbaa49e30edf66ddb5e256c873cde54d
parent3e8af71bb4b320cea1c32517ef055d7dbfc0b73b (diff)
downloadrtems-docs-6a20bd2f4f92d39afd06fc0746fd3e8a74b75513.tar.bz2
c-user: Document rtems_task_exit()
Close #3533.
-rw-r--r--c-user/task_manager.rst47
1 files changed, 46 insertions, 1 deletions
diff --git a/c-user/task_manager.rst b/c-user/task_manager.rst
index aff9185..f48aa13 100644
--- a/c-user/task_manager.rst
+++ b/c-user/task_manager.rst
@@ -27,6 +27,8 @@ and administer tasks. The directives provided by the task manager are:
- rtems_task_delete_ - Delete a task
+- rtems_task_exit_ - Delete the calling task
+
- rtems_task_suspend_ - Suspend a task
- rtems_task_resume_ - Resume a task
@@ -515,7 +517,8 @@ task, frees the task's control block, removes it from resource wait queues, and
deallocates its stack as well as the optional floating point context. The
task's name and ID become inactive at this time, and any subsequent references
to either of them is invalid. In fact, RTEMS may reuse the task ID for another
-task which is created later in the application.
+task which is created later in the application. A specialization of
+``rtems_task_delete`` is ``rtems_task_exit`` which deletes the calling task.
Unexpired delay timers (i.e. those used by ``rtems_task_wake_after`` and
``rtems_task_wake_when``) and timeout timers associated with the task are
@@ -1005,6 +1008,48 @@ NOTES:
\clearpage
+.. index:: deleting a task
+.. index:: rtems_task_exit
+
+.. _rtems_task_exit:
+
+TASK_EXIT - Delete the calling task
+-----------------------------------
+
+CALLING SEQUENCE:
+ .. code-block:: c
+
+ void rtems_task_exit( void ) RTEMS_NO_RETURN;
+
+DIRECTIVE STATUS CODES:
+ NONE - This function will not return to the caller.
+
+DESCRIPTION:
+ This directive deletes the calling task.
+
+NOTES:
+ This directive must be called from a regular task context with enabled
+ interrupts, otherwise one of the fatal errors
+
+ * :ref:`INTERNAL_ERROR_BAD_THREAD_DISPATCH_DISABLE_LEVEL <internal_errors>`, or
+ * :ref:`INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT <internal_errors>`
+
+ will occur.
+
+ The ``rtems_task_exit()`` call is equivalent to the following code
+ sequence:
+
+ .. code-block:: c
+
+ pthread_detach(pthread_self());
+ pthread_exit(NULL);
+
+ See also :ref:`rtems_task_delete() <rtems_task_delete>`.
+
+.. raw:: latex
+
+ \clearpage
+
.. index:: suspending a task
.. index:: rtems_task_suspend