Fix incorrect usage of __libcpp_mutex_trylock. Patch from Andrey Khalyavin

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302129 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-05-04 07:45:09 +00:00
parent b8577430ea
commit 474dfc389d

View File

@@ -154,7 +154,7 @@ __sp_mut::lock() _NOEXCEPT
{
auto m = static_cast<__libcpp_mutex_t*>(__lx);
unsigned count = 0;
while (__libcpp_mutex_trylock(m) != 0)
while (!__libcpp_mutex_trylock(m))
{
if (++count > 16)
{