[libcxx] r302129 - Fix incorrect usage of __libcpp_mutex_trylock. Patch from Andrey Khalyavin

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu May 4 00:45:09 PDT 2017


Author: ericwf
Date: Thu May  4 02:45:09 2017
New Revision: 302129

URL: http://llvm.org/viewvc/llvm-project?rev=302129&view=rev
Log:
Fix incorrect usage of __libcpp_mutex_trylock. Patch from Andrey Khalyavin

Modified:
    libcxx/trunk/src/memory.cpp

Modified: libcxx/trunk/src/memory.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/memory.cpp?rev=302129&r1=302128&r2=302129&view=diff
==============================================================================
--- libcxx/trunk/src/memory.cpp (original)
+++ libcxx/trunk/src/memory.cpp Thu May  4 02:45:09 2017
@@ -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)
         {




More information about the cfe-commits mailing list