<div dir="ltr">Did it broke a bot? Please include a reason to revert when you revert a commit. Thanks! Regards<div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 14, 2019 at 3:39 PM Nick Desaulniers via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: nickdesaulniers<br>
Date: Thu Feb 14 15:39:32 2019<br>
New Revision: 354080<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=354080&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=354080&view=rev</a><br>
Log:<br>
Revert "[lld] Fix elf::unlinkAsync detached thread"<br>
<br>
This reverts commit 2694810153cf992823eb45253d26b8567424438f.<br>
<br>
Modified:<br>
lld/trunk/ELF/Filesystem.cpp<br>
<br>
Modified: lld/trunk/ELF/Filesystem.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Filesystem.cpp?rev=354080&r1=354079&r2=354080&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Filesystem.cpp?rev=354080&r1=354079&r2=354080&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/Filesystem.cpp (original)<br>
+++ lld/trunk/ELF/Filesystem.cpp Thu Feb 14 15:39:32 2019<br>
@@ -58,26 +58,9 @@ void elf::unlinkAsync(StringRef Path) {<br>
std::error_code EC = sys::fs::openFileForRead(Path, FD);<br>
sys::fs::remove(Path);<br>
<br>
- if (EC)<br>
- return;<br>
-<br>
// close and therefore remove TempPath in background.<br>
- std::mutex M;<br>
- std::condition_variable CV;<br>
- bool Started = false;<br>
- std::thread([&, FD] {<br>
- {<br>
- std::lock_guard<std::mutex> L(M);<br>
- Started = true;<br>
- CV.notify_all();<br>
- }<br>
- ::close(FD);<br>
- }).detach();<br>
-<br>
- // GLIBC 2.26 and earlier have race condition that crashes an entire process<br>
- // if the main thread calls exit(2) while other thread is starting up.<br>
- std::unique_lock<std::mutex> L(M);<br>
- CV.wait(L, [&] { return Started; });<br>
+ if (!EC)<br>
+ std::thread([=] { ::close(FD); }).detach();<br>
#endif<br>
}<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>