TaiJuWu commented on PR #10776: URL: https://github.com/apache/nuttx/pull/10776#issuecomment-1751203089
@xiaoxiang781216 Sorry, I have two questions. First, In current spin_lock_irqsave() and spin_lock_irqrestore(), it need to support global spinlock(g_irq_spin)? Linux kernel seems not to support this feature. Does read/write spinlock also need support this feature? Second, Why does spin_lock_irqrestore() need to support nested spinlock? From [source code](https://github.com/TaiJuWu/nuttx/blob/921ae08e936d0bbdf7c056b21f8f5f5bf5f8dee1/sched/irq/irq_spinlock.c#L90), I can image a usage is ``` irqstate_t level1 = spin_lock_irqsave() irqstate_t level2 = spin_lock_irqsave() C.S spin_lock_irqrestore(level2); spin_lock_irqrestore(level1); ``` This is a little tricky for me and this feature is not used in kernel. -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org