[libcxx-commits] [PATCH] D113054: [libcxxabi][SystemZ][z/OS] Update libcxxabi/src/cxa_exception_storage.cpp to support POSIX(OFF)

Jon Roelofs via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 3 10:57:05 PDT 2021


jroelofs added inline comments.


================
Comment at: libcxxabi/src/cxa_exception_storage.cpp:95
     __cxa_eh_globals *__cxa_get_globals_fast() {
-        // First time through, create the key.
-        if (0 != std::__libcpp_execute_once(&flag_, construct_))
-            abort_message("execute once failure in __cxa_get_globals_fast()");
-        return static_cast<__cxa_eh_globals*>(std::__libcpp_tls_get(key_));
+      // If threads are disabled at runtime, revert to single-threaded implementation.
+      static const bool threadsEnabled = std::__libcpp_are_threads_enabled();
----------------
I think this design requires that a platform never have the ability to transition a process from disabled threads to enabled threads. Even if x/OS cannot do that (can it?), I think it's important to capture that in the documentation of `__libcpp_are_threads_enabled` in the other patch. Perhaps this static variable ought to be hoisted into that function's implementation too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113054



More information about the libcxx-commits mailing list