[Lldb-commits] [PATCH] D131081: [lldb] Prevent race condition when fetching /proc/cpuinfo

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 8 13:58:10 PDT 2022


clayborg added a comment.

In D131081#3699295 <https://reviews.llvm.org/D131081#3699295>, @labath wrote:

> It's not clear to me why you're insisting on `call_once`, when c++ guarantees that the function-local statics will only be initialized once (atomically). And with the new version, we don't even need the lambda..

I tend to use call_once to avoid an issue, IIRC, that older windows compilers had with the "statics will only be initialized once (atomically)". I seem to remember Microsoft compilers were not fully compliant with this and that it could cause multi-threading issues, but I don't know if this has been fixed or if this wouldn't be an issue in this case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131081/new/

https://reviews.llvm.org/D131081



More information about the lldb-commits mailing list