• mtklein's avatar
    Fix the race to set the new gen ID. · 59c92033
    mtklein authored
    There's a small window where two threads can both see the gen ID is zero,
    both go get new distinct genIDs, but race to write them.
    
    This now uses compare_exchange to read and leave the winner's ID in place
    when there's a race.
    
    SkAtomics isn't public.
    TBR=reed@google.com
    
    BUG=skia:
    
    Review URL: https://codereview.chromium.org/956013002
    59c92033
SkAtomics.h 3.44 KB