<div dir="auto"><div>Last time I looked the attributes weren't expressive enough to model unique_lock.</div><div dir="auto">I don't believe there's any work on going to improve this.<br></div><div dir="auto"><br></div><div dir="auto">I'll happily annotate `unique_lock` when Clang can model it. </div><div dir="auto"><br></div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Fri, Oct 11, 2019, 9:51 PM Pooyan McSporran via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br></div><div><br></div><div>I've been experimenting with -Wthread-safety in clang/libc++.  The documentation at <a href="https://libcxx.llvm.org/docs/UsingLibcxx.html" rel="noreferrer noreferrer noreferrer" target="_blank">https://libcxx.llvm.org/docs/UsingLibcxx.html</a> says that _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS is 'used to enable -Wthread-safety annotations on libc++’s std::mutex and std::lock_guard'.</div><div><br></div><div>I'm hoping to use thread-safety analysis for a sizeable code base which makes a lot of use of unique_lock, but there's no libc++ annotations for unique_lock, just for lock_guard.  What is the status of this?  Is this something that might be addressed in the future, or is it fundamentally problematic?  I gather it's complicated by the optional deferred locking semantics.<br></div><div><br></div><div>For my purposes I can work around the issue by changing uses of unique_lock to instead be lock_guard (which needs to be done anyway) so it's not a show-stopper for me, just curious.</div><div><br></div><div>Thanks!<br></div></div>
_______________________________________________<br>
libcxx-dev mailing list<br>
<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer noreferrer noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a><br>
</blockquote></div>
</div></div>