June 25, 2020
4:07 p.m.
This doesn't look safe regarding sample_refs update. It's tested for != 0 within critical section, but is updated separately.