Report fatal error and abort if any cpuinfo_get_* function is called before initialization
diff --git a/src/arm/linux/init.c b/src/arm/linux/init.c
index 197b48f..dd54668 100644
--- a/src/arm/linux/init.c
+++ b/src/arm/linux/init.c
@@ -557,6 +557,10 @@
cpuinfo_cache_count[cpuinfo_cache_level_1d] = usable_processors;
cpuinfo_cache_count[cpuinfo_cache_level_2] = l2_count;
+ __sync_synchronize();
+
+ cpuinfo_is_initialized = true;
+
linux_cpu_to_processor_map = NULL;
linux_cpu_to_core_map = NULL;
processors = NULL;
diff --git a/src/arm/mach/init.c b/src/arm/mach/init.c
index 2d8feeb..d8e0ab6 100644
--- a/src/arm/mach/init.c
+++ b/src/arm/mach/init.c
@@ -483,6 +483,10 @@
cpuinfo_cores_count = mach_topology.cores;
cpuinfo_packages_count = mach_topology.packages;
+ __sync_synchronize();
+
+ cpuinfo_is_initialized = true;
+
processors = NULL;
cores = NULL;
packages = NULL;