1a4de8 Backport a few upstream thread safety fixes

Authored and Committed by pemensik 5 years ago
    Backport a few upstream thread safety fixes
    
    It might not fix all issues, but was detected by upstream using
    automated tool. Should not break anything new, but might fix issue
    triggered usually on ppc64le platform.
    
        
file modified
+9 -0