jianglianfang opened a new pull request, #18938: URL: https://github.com/apache/nuttx/pull/18938
Summary On SMP systems, enter_critical_section()/leave_critical_section() only disables interrupts on the local CPU, leaving shared data structures (goldfish_fb interrupt status, VNC update queue) unprotected from concurrent access by other cores. This patch replaces critical sections with per-device spinlocks (spin_lock_irqsave/spin_unlock_irqrestore) in: goldfish_fb.c: interrupt handler vnc_updater.c: update queue alloc/free/add/remove operations The _nopreempt variants are used in vnc_free_update() and vnc_add_queue() where nxsem_post() is called under the lock, to avoid triggering preemption while the spinlock is held. Impact SMP correctness: Fixes potential race conditions on multi-core targets using goldfish_fb or VNC server. Single-core: No functional change — spinlock degrades to interrupt disable on UP systems. Compatibility: No API change. Internal locking only. -- 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]
