You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/13 17:47:44 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request, #7589: sched: Let nxsched_get_tcb return the current task if pid < 0

xiaoxiang781216 opened a new pull request, #7589:
URL: https://github.com/apache/incubator-nuttx/pull/7589

   ## Summary
   boost the most frequent operation from:
     nxsched_get_tcb(get_pid(());
   to:
     nxsched_get_tcb(-1);
   
   Note: we can't call this_task directly since it declared in sched/sched.h
   
   ## Impact
   nxsched_get_tcb
   
   ## Testing
   Pass CI
   


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] acassis commented on pull request #7589: sched: Let nxsched_get_tcb return the current task if pid < 0

Posted by GitBox <gi...@apache.org>.
acassis commented on PR #7589:
URL: https://github.com/apache/incubator-nuttx/pull/7589#issuecomment-1312888764

   Why to do it? It could create a trap to developers case some driver try to pass a function ( as parameter) that should return a PID but if that function fails for some reason, then this new nxsched_get_tcb() will return "happily" the TCB of current PID instead, because it is receiving a negative parameter. Normally POSIX functions don't do that exactly because this "pipe" issue.


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #7589: sched: Let nxsched_get_tcb return the current task if pid < 0

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #7589:
URL: https://github.com/apache/incubator-nuttx/pull/7589#issuecomment-1313178923

   Look like we already have nxsched_self:
   https://github.com/apache/incubator-nuttx/blob/master/sched/sched/sched_self.c#L43
   The special hack isn't necessary:).


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 closed pull request #7589: sched: Let nxsched_get_tcb return the current task if pid < 0

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 closed pull request #7589: sched: Let nxsched_get_tcb return the current task if pid < 0
URL: https://github.com/apache/incubator-nuttx/pull/7589


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org