[PATCH] D140791: [DWARFLinkerNext] Add simple list with thread safe insertions.

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 31 01:00:55 PST 2022


avl added inline comments.


================
Comment at: llvm/include/llvm/DWARFLinkerNext/List.h:24
+public:
+  T *Next = nullptr;
+};
----------------
tschuett wrote:
> not atomic?
only "Head" requires std::atomic. as only "Head" field is changed by different threads.  


================
Comment at: llvm/include/llvm/DWARFLinkerNext/List.h:45
+  void addItem(T *NewItem) {
+    T *CurHead = nullptr;
+    do {
----------------
tschuett wrote:
> not atomic?
CurHead is not visible or changed by other threads, thus not necessarily to make it atomic.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140791



More information about the llvm-commits mailing list