xiaoxiang781216 commented on PR #17300: URL: https://github.com/apache/nuttx/pull/17300#issuecomment-3516863877
> > The current tcb should never be NULL, that's why change the runtime check to DEBUGASSERT, which mean that it's a program error calling sched_lock with the current tcb is NULL, and should fix the cause which change the current tcb to NULL instead. Please read the online documentation to learn the difference between assert and runtime check: https://en.wikipedia.org/wiki/Assertion_(software_development) > > Since rtcb could be NULL, why does this commit remove the rtcb check? If you can accept the scenario where rtcb is a NULL pointer, why do you still need to check it in DEBUGASSERT? assert express the contract explicitly. Again, I would suggest you to read some software design book or article: https://en.wikipedia.org/wiki/Design_by_contract -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
