xiaoxiang781216 commented on a change in pull request #1141:
URL: https://github.com/apache/incubator-nuttx/pull/1141#discussion_r436430170
##########
File path: include/nuttx/sched.h
##########
@@ -103,9 +103,10 @@
# define TCB_FLAG_SCHED_SPORADIC (2 << TCB_FLAG_POLICY_SHIFT) /* Sporadic
scheding policy */
# define TCB_FLAG_SCHED_OTHER (3 << TCB_FLAG_POLICY_SHIFT) /* Other
scheding policy */
#define TCB_FLAG_CPU_LOCKED (1 << 7) /* Bit 7:
Locked to this CPU */
-#define TCB_FLAG_SIGNAL_ACTION (1 << 8) /* Bit 8: In
a signal handler */
-#define TCB_FLAG_SYSCALL (1 << 9) /* Bit 9: In
a system call */
-#define TCB_FLAG_EXIT_PROCESSING (1 << 10) /* Bit 10:
Exitting */
+#define TCB_FLAG_CUSTOM_STACK (1 << 8) /* Bit 8:
Thread uses a custom stack */
Review comment:
@patacongo TCB_FLAG_CUSTOM_STACK is redundancy because up_release_stack
already call xmm_heapmember before free the memory:
```
void up_release_stack(FAR struct tcb_s *dtcb, uint8_t ttype)
{
/* Is there a stack allocated? */
if (dtcb->stack_alloc_ptr)
{
#ifdef CONFIG_MM_KERNEL_HEAP
/* Use the kernel allocator if this is a kernel thread */
if (ttype == TCB_FLAG_TTYPE_KERNEL)
{
if (kmm_heapmember(dtcb->stack_alloc_ptr))
{
kmm_free(dtcb->stack_alloc_ptr);
}
}
else
#endif
{
/* Use the user-space allocator if this is a task or pthread */
if (umm_heapmember(dtcb->stack_alloc_ptr))
{
kumm_free(dtcb->stack_alloc_ptr);
}
}
/* Mark the stack freed */
dtcb->stack_alloc_ptr = NULL;
}
/* The size of the allocated stack is now zero */
dtcb->adj_stack_size = 0;
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]