• ahaas's avatar
    [wasm] Use a LazyInstance in wasm-linkage.cc to avoid a data race. · 282cdf28
    ahaas authored
    The initialization of static variables that were used originally caused
    a data race because multiple threads tried to initialize the variables
    at the same time. The use of a LazyInstance guarantees that the
    variables get initialized exactly once.
    
    The same problem also existed in c-linkage.cc. There I fixed the problem
    by using a local variable instead of a static variable.
    
    BUG=v8:5242
    R=titzer@chromium.org
    
    Review-Url: https://codereview.chromium.org/2202433003
    Cr-Commit-Position: refs/heads/master@{#38221}
    282cdf28
wasm-linkage.cc 13.8 KB