hujun260 commented on code in PR #14578:
URL: https://github.com/apache/nuttx/pull/14578#discussion_r1847563134
##########
sched/sched/sched_lock.c:
##########
@@ -46,6 +46,30 @@
* Public Functions
****************************************************************************/
+/****************************************************************************
+ * Name: sched_lock_wo_note
+ *
+ * Description:
+ * This function disables context switching.
+ * It does not perform instrumentation logic.
+ *
+ ****************************************************************************/
+
+bool sched_lock_wo_note(void)
+{
+ FAR struct tcb_s *tcb;
+
+ if (OSINIT_TASK_READY() && !up_interrupt_context())
+ {
+ tcb = this_task();
+ tcb->lockcount++;
+
+ return tcb->lockcount == 1 ? true : false;
Review Comment:
lockcount is only modified and read by the current task, and there are no
race condition here
--
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]