[lld] r305718 - Fix a threading bug.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 11:03:52 PDT 2017


Ugh, I made a mistake at last minute. I'll fix it in 15 minutes (I'm not in
front of a computer now), but feel free to revert it yourself. I'm sorry
about this mistake.

On Jun 19, 2017 10:57 AM, "Davide Italiano" <davide at freebsd.org> wrote:

On Mon, Jun 19, 2017 at 10:47 AM, Rui Ueyama via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: ruiu
> Date: Mon Jun 19 12:47:04 2017
> New Revision: 305718
>
> URL: http://llvm.org/viewvc/llvm-project?rev=305718&view=rev
> Log:
> Fix a threading bug.
>
> Modified:
>     lld/trunk/COFF/Strings.cpp
>
> Modified: lld/trunk/COFF/Strings.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/
Strings.cpp?rev=305718&r1=305717&r2=305718&view=diff
> ============================================================
==================
> --- lld/trunk/COFF/Strings.cpp (original)
> +++ lld/trunk/COFF/Strings.cpp Mon Jun 19 12:47:04 2017
> @@ -8,6 +8,7 @@
>  //===-------------------------------------------------------
---------------===//
>
>  #include "Strings.h"
> +#include <mutex>
>
>  #if defined(_MSC_VER)
>  #include <Windows.h>
> @@ -21,6 +22,10 @@ using namespace llvm;
>
>  Optional<std::string> coff::demangle(StringRef S) {
>  #if defined(_MSC_VER)
> +  // UnDecorateSymbolName is not thread-safe, so we need a mutex.
> +  static std::mutex Mu;
> +  std::lock_guard<std::mutex> Lock(mu);
> +

I may be wrong here, but how this works? [case-insensitiveness, maybe]
You have `mu` and `Mu`.

--
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170619/592b6697/attachment.html>


More information about the llvm-commits mailing list