task/pthread_cancelpt: Move cancel point handling to libc, data to TLS

This moves task / thread cancel point logic from the NuttX kernel into
libc, while the data needed by the cancel point logic is moved to TLS.

The change is an enabler to move user-space APIs to libc as well, for
a coherent user/kernel separation.
This commit is contained in:
Ville Juven
2023-11-10 12:56:10 +02:00
committed by Xiang Xiao
parent 1e31ec8003
commit 0dedbcd4ae
24 changed files with 414 additions and 547 deletions
-11
View File
@@ -430,17 +430,6 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status)
return;
}
#ifdef CONFIG_CANCELLATION_POINTS
/* Mark the task as non-cancelable to avoid additional calls to exit()
* due to any cancellation point logic that might get kicked off by
* actions taken during exit processing.
*/
tcb->flags |= TCB_FLAG_NONCANCELABLE;
tcb->flags &= ~TCB_FLAG_CANCEL_PENDING;
tcb->cpcount = 0;
#endif
/* If the task was terminated by another task, it may be in an unknown
* state. Make some feeble effort to recover the state.
*/