[libcxx-commits] [PATCH] D110088: [libcxxabi] Make InitByteGlobalMutex check GetThreadID instead of PlatformThreadID

Daniel McIntosh via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 20 14:37:14 PDT 2021


DanielMcIntosh-IBM added a comment.

In D110088#3010529 <https://reviews.llvm.org/D110088#3010529>, @ldionne wrote:

> Can you quickly explain why this is going to simplify your life in the other patches? Without knowing more about your motivations, I would say that `PlatformSupportsThreadID()` provides more information to the reader than testing `PlatfromThreadID != nullptr`, so I'd be tempted to think it's a useful abstraction to keep. Why are you removing it?

Removing `PlatformSupportsThreadID()` was not the purpose of this change. The purpose was to fix `InitByteGlobalMutex`. It just so happens that after fixing `InitByteGlobalMutex`, `PlatformSupportsThreadID()` is no longer used outside the test, at which point I figured it's dead code and should be removed. I could leave it there too, and it wouldn't cause any problems, but since all the Guards (except NoThreadsGuard) have a function pointer template parameter argument, they should be checking their template argument, not PlatfromThreadID, rendering `PlatformSupportsThreadID` useless anyways.

As for simplifying my life in the other patches, I suppose it doesn't really, and could probably go in as a separate patch independent of the rest of the cxa_guard re-write.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110088



More information about the libcxx-commits mailing list