mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
Merged in masayuki2009/nuttx.nuttx/clock_systimer (pull request #570)
clock_systimer: Replace critical section APIs with spinlock APIs. (64bit only) Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
@@ -120,9 +120,9 @@ systime_t clock_systimer(void)
|
|||||||
|
|
||||||
/* 64-bit accesses are not atomic on most architectures. */
|
/* 64-bit accesses are not atomic on most architectures. */
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = spin_lock_irqsave();
|
||||||
sample = g_system_timer;
|
sample = g_system_timer;
|
||||||
leave_critical_section(flags);
|
spin_unlock_irqrestore(flags);
|
||||||
return sample;
|
return sample;
|
||||||
|
|
||||||
# else /* CONFIG_SYSTEM_TIME64 */
|
# else /* CONFIG_SYSTEM_TIME64 */
|
||||||
|
|||||||
Reference in New Issue
Block a user