<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I think it makes sense for libc++ to have a version of mutex which has the same API as the standard one, but for “freestanding” platforms such as yours. A flavor which mostly just spins and yields as in your review.<div class=""><br class=""></div><div class="">I’m not sure how to best turn it on, though. Should it be controlled by a macro, and otherwise it just looks like you’re using <mutex>?<br class=""><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 17, 2019, at 1:49 PM, Mitch Phillips via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi all,<div class=""><br class=""></div><div class="">In a recent <a href="https://reviews.llvm.org/D61923#1503272" class="">discussion</a> from the reviews of <a href="https://reviews.llvm.org/D60593" class="">GWP-ASan</a>, it was mentioned that I should probably consult with cxx-dev to see whether they'd be interested in a common spinlock implementation.</div><div class=""><br class=""></div><div class="">The problem is:</div><div class=""> - Scudo hardened allocator (compiler-rt/lib/scudo) requires its own spinlock as it can't use the C++ standard library due to Fuchsia requirements.</div><div class=""> - GWP-ASan (as it's packaged into Scudo) also requires a spinlock.</div><div class=""> - Compiler-rt sanitizer_common also can't use c++ stdlib, and has its own spinlock. We can't reuse the sanitizer_common spinlock for Scudo/GWP-ASan as it's currently tightly coupled into sanitizer_common, and Scudo+Fuchsia can't afford the code size overhead of pulling the entire sanitizer_common library.</div><div class=""><br class=""></div><div class="">The plan was to basically write a small standalone spinlock implementation that can be used by all three of these requirements. Would libcxx benefit by us making this an llvm-common spinlock rather than compiler-rt-common? If so, are there any requirements that we need to be aware of?</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Mitch.</div></div>
_______________________________________________<br class="">libcxx-dev mailing list<br class=""><a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev<br class=""></div></blockquote></div><br class=""></div></div></body></html>