From 698597a838fe89cb4c2e2a73f71be3c5bdce0802 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 10 Dec 2016 14:39:19 -0600 Subject: [PATCH] task_delete() now obeys all cancellation point semantics. --- Documentation/NuttxUserGuide.html | 22 ++++- sched/pthread/pthread_cancel.c | 14 +-- sched/task/task_delete.c | 146 ++++++++++++++++++++---------- sched/task/task_restart.c | 2 +- 4 files changed, 126 insertions(+), 58 deletions(-) diff --git a/Documentation/NuttxUserGuide.html b/Documentation/NuttxUserGuide.html index ada2c6d9e1a..c4bc4c839d9 100644 --- a/Documentation/NuttxUserGuide.html +++ b/Documentation/NuttxUserGuide.html @@ -13,7 +13,7 @@

NuttX Operating System

User's Manual

by

Gregory Nutt

-

Last Updated: December 9, 2016

+

Last Updated: December 10, 2016

@@ -469,8 +469,21 @@ int task_delete(pid_t pid);

Description: - This function causes a specified task to cease to exist -- its stack and TCB will be deallocated. - This function is the companion to task_create(). + This function causes a specified task to cease to exist. + Its stack and TCB will be deallocated. + This function is the companion to task_create(). + This is the version of the function exposed to the user; + it is simply a wrapper around the internal, task_terminate() function. +

+

+ The logic in this function only deletes non-running tasks. + If the pid parameter refers to to the currently runing task, then processing is redirected to exit(). + This can only happen if a task calls task_delete() in order to delete itself. +

+

+ This function obeys the semantics of pthread cancellation: + task deletion is deferred if cancellation is disabled or if deferred cancellation is supported (with cancellation points enabled). +

Input Parameters: