hujun260 commented on code in PR #17383:
URL: https://github.com/apache/nuttx/pull/17383#discussion_r2567640235
##########
arch/x86_64/src/intel64/intel64_cpu.c:
##########
@@ -366,14 +366,7 @@ bool x86_64_cpu_ready_get(uint8_t cpu)
uint8_t x86_64_cpu_count_get(void)
{
- irqstate_t flags;
- uint8_t count;
-
- flags = spin_lock_irqsave(&g_ap_boot);
- count = g_cpu_count;
- spin_unlock_irqrestore(&g_ap_boot, flags);
-
- return count;
+ return g_cpu_count;
Review Comment:
Merely reading a global variable and spin_lock serves no practical purpose.
It will not cause a race condition
--
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]