You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/01/26 13:15:32 UTC

[nuttx] 02/02: Revert "sched/release_tcb: Do not release stack for user processes here"

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 1c84fc9cd9d7211cea8b14518ea4566055c5f65f
Author: Ville Juven <vi...@unikie.com>
AuthorDate: Thu Jan 19 09:44:34 2023 +0200

    Revert "sched/release_tcb: Do not release stack for user processes here"
    
    This reverts commit 1a67dc7c6839bdcb968bf5865ab3088bd7e9222a.
---
 sched/sched/sched_releasetcb.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/sched/sched/sched_releasetcb.c b/sched/sched/sched_releasetcb.c
index 4ea3a98cd3..ab644ce783 100644
--- a/sched/sched/sched_releasetcb.c
+++ b/sched/sched/sched_releasetcb.c
@@ -126,22 +126,7 @@ int nxsched_release_tcb(FAR struct tcb_s *tcb, uint8_t ttype)
 
       if (tcb->stack_alloc_ptr)
         {
-    #ifdef CONFIG_BUILD_KERNEL
-          /* If the exiting thread is not a kernel thread, then it has an
-           * address environment.  Don't bother to release the stack memory
-           * in this case... There is no point since the memory lies in the
-           * user memory region that will be destroyed anyway (and the
-           * address environment has probably already been destroyed at
-           * this point.. so we would crash if we even tried it).  But if
-           * this is a privileged group, when we still have to release the
-           * memory using the kernel allocator.
-           */
-
-          if (ttype == TCB_FLAG_TTYPE_KERNEL)
-    #endif
-            {
-              up_release_stack(tcb, ttype);
-            }
+          up_release_stack(tcb, ttype);
         }
 
 #ifdef CONFIG_PIC