mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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 <hujun5@xiaomi.com>
This commit is contained in:
parent
b72f7997a3
commit
19dcc896d7
2 changed files with 10 additions and 2 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue