[libcxx-commits] [PATCH] D64299: Make ~mutex and ~condition_variable trivial with Bionic pthreads

Eric Fiselier via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 16 23:13:06 PDT 2019


On Wed., Jul. 17, 2019, 12:50 a.m. Eric Fiselier via Phabricator, <
reviews at reviews.llvm.org> wrote:

> EricWF added a comment.
>
> For sanitizers I wonder if we could continue to catch use after destrot
> without losing triviality.  Doesn't MSAN poison the objects memory at the
> end of the destructor?
>
> I considered adding the destructor back in debug modes, but this can break
> or deadlock code by introducing a potentially blocking region into the
> middle of a carfully considered locking algir
>

*This can deadlock an otherwise carefully designed concurrent algorithm.

Ideally, I think we would want to make static storage duration mutex's
trivial, while maintaining debugability on the rest.

We could extend [[clang::no_destroy]] to apply to class types and mean
"don't destroy instances with static storage duration".



>
> Repository:
>   rCXX libc++
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D64299/new/
>
> https://reviews.llvm.o <https://reviews.llvm.org/D64299>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190717/66f95c55/attachment-0001.html>


More information about the libcxx-commits mailing list