• Dan Schatzberg's avatar
    Fix ThreadCachedInt race condition · bae33d68
    Dan Schatzberg authored
    Summary:
    Move ThreadLocal object destruction to occur under the lock to avoid races.
    This causes a few cascading changes - the Tag lock needs to be a recursive_mutex so
    constructing a new object while destroying another st. Also, forking requires
    a new mutex to avoid deadlocking on accessing a recursive_mutex across a fork()
    
    Reviewed By: andriigrynenko
    
    Differential Revision: D3755446
    
    fbshipit-source-id: bb4c4f29bab98d763490df29b460066f124303e0
    bae33d68
ThreadCachedIntTest.cpp 15.8 KB