hujun260 commented on code in PR #14578:
URL: https://github.com/apache/nuttx/pull/14578#discussion_r1825383575


##########
include/nuttx/spinlock.h:
##########
@@ -529,6 +529,7 @@ irqstate_t spin_lock_irqsave_wo_note(FAR volatile 
spinlock_t *lock)
 {
   irqstate_t ret;
   ret = up_irq_save();
+  sched_lock_wo_note();

Review Comment:
   @anchao 
   I'm not entirely sure if I understand it correctly,
   but if we disable interrupts after acquiring a spinlock,
   when an interrupt occurs during the execution of a test-and-set loop in 
spin_lock_irqsave
   and attempts to acquire the same spinlock within the interrupt handler, it 
can lead to a deadlock.
   Synchronization between interrupts and threads cannot be achieved in this 
case.



-- 
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]

Reply via email to