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

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


The following commit(s) were added to refs/heads/master by this push:
     new 19dcc896d sched/tcb: add a reference count to the TCB to prevent it 
from being deleted.
19dcc896d is described below

commit 19dcc896d7f88392a891fb415753d3e9c905fdf6
Author: hujun5 <[email protected]>
AuthorDate: Wed Feb 12 19:16:09 2025 +0800

    sched/tcb: add a reference count to the TCB to prevent it from being 
deleted.
    
    To replace the large lock with smaller ones and reduce the large locks 
related to the TCB,
    in many scenarios, we only need to ensure that the TCB won't be released
    instead of locking, thus reducing the possibility of lock recursion.
    
    Signed-off-by: hujun5 <[email protected]>
---
 .codespell-ignore-lines             | 4 ++++
 crypto/controlse/controlse_main.cxx | 8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/.codespell-ignore-lines b/.codespell-ignore-lines
index 75a07676e..4b6f55c66 100644
--- a/.codespell-ignore-lines
+++ b/.codespell-ignore-lines
@@ -1,2 +1,6 @@
       mynewt-nimble/nimble/host/services/ans/src/ble_svc_ans.c
       mynewt-nimble/nimble/host/services/ans/include
+#include "crypto/controlse/ccertificate.hxx"
+              object = new Controlse::CCertificate(
+          Controlse::CCertificate cert(se, settings->key_id);
+      auto certificate = Controlse::CCertificate(
diff --git a/crypto/controlse/controlse_main.cxx 
b/crypto/controlse/controlse_main.cxx
index 8c0f07cbc..a2b5dddef 100644
--- a/crypto/controlse/controlse_main.cxx
+++ b/crypto/controlse/controlse_main.cxx
@@ -701,8 +701,12 @@ int main(int argc, FAR char *argv[])
 #ifdef CONFIG_STACK_COLORATION
       FAR struct tcb_s *tcb;
       tcb = nxsched_get_tcb(getpid());
-      fprintf(stderr, "\nStack used: %zu / %zu\n", up_check_tcbstack(tcb),
-              tcb->adj_stack_size);
+      if (tcb != NULL)
+        {
+          fprintf(stderr, "\nStack used: %zu / %zu\n", up_check_tcbstack(tcb),
+                  tcb->adj_stack_size);
+          nxsched_put_tcb(tcb);
+        }
 #else
       fprintf(stderr, "\nStack used: unknown"
                       " (STACK_COLORATION must be enabled)\n");

Reply via email to