[lld] r317632 - Use std::thread directly.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 15:09:54 PST 2017


Author: rafael
Date: Tue Nov  7 15:09:54 2017
New Revision: 317632

URL: http://llvm.org/viewvc/llvm-project?rev=317632&view=rev
Log:
Use std::thread directly.

Now that this code is posix only we don't need to use runBackground.

Modified:
    lld/trunk/ELF/Filesystem.cpp

Modified: lld/trunk/ELF/Filesystem.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Filesystem.cpp?rev=317632&r1=317631&r2=317632&view=diff
==============================================================================
--- lld/trunk/ELF/Filesystem.cpp (original)
+++ lld/trunk/ELF/Filesystem.cpp Tue Nov  7 15:09:54 2017
@@ -20,6 +20,7 @@
 #if defined(HAVE_UNISTD_H)
 #include <unistd.h>
 #endif
+#include <thread>
 
 using namespace llvm;
 
@@ -61,7 +62,7 @@ void elf::unlinkAsync(StringRef Path) {
   sys::fs::remove(Path);
 
   // close and therefore remove TempPath in background.
-  runBackground([=] { ::close(FD); });
+  std::thread([=] { ::close(FD); }).detach();
 #endif
 }
 




More information about the llvm-commits mailing list