[PATCH] D58246: [lld] Fix elf::unlinkAsync detached thread

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 14 12:41:03 PST 2019


ruiu added inline comments.


================
Comment at: lld/ELF/Filesystem.cpp:62
   // close and therefore remove TempPath in background.
-  if (!EC)
-    std::thread([=] { ::close(FD); }).detach();
+  if (!EC) {
+    std::mutex M;
----------------
Flip the condition and return early.


================
Comment at: lld/ELF/Filesystem.cpp:63
+  if (!EC) {
+    std::mutex M;
+    std::condition_variable CV;
----------------
Please leave a comment why we are waiting for a thread startup.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58246





More information about the llvm-commits mailing list