Commits


Yibo Cai authored and Sutou Kouhei committed ced5cf9fa14
ARROW-7464: [C++] Refine CpuInfo singleton with std::call_once CpuInfo singleton is created and initialized on first invocation of [CpuInfo::GetInstance()](https://github.com/apache/arrow/blob/master/cpp/src/arrow/util/cpu_info.cc#L188-L195). All calls afterwards return reference to the same instance. Current code uses std::mutex to make sure that CpuInfo is created only once, but it introduces unnecessary overhead for later calls. Concurrent threads getting the created instance should not block each other. Replace std::mutex with std::call_once to fix this issue. References: [1] https://en.cppreference.com/w/cpp/thread/call_once [2] http://www.modernescpp.com/index.php/thread-safe-initialization-of-data Closes #6091 from cyb70289/callonce and squashes the following commits: f98632dda <Yibo Cai> Rename cpuinfo_once to cpuinfo_initialized 427579b5f <Yibo Cai> Fix lint issue b75cd43b9 <Yibo Cai> ARROW-7464: : Refine CpuInfo singleton with std::call_once Authored-by: Yibo Cai <yibo.cai@arm.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>