hazptr: Fix batch push obj
Summary: Fix missing null check. It is possible for a thread to successfully CAS count from >= threshold to 0 and also pop an empty list. Example with 2 threads: - Batch contains Threshold - 1 objects - Thread 1 pushes an object, finds count == Threshold, CAS-es count to 0 successfully. - Thread 2 pushes Threshold more objects, finds count == Threshold, CAS-es count to 0 successfully. - Thread 1 pops all 2xThreshold objects (that's ok) - Thread 2 pops 0 objects (that's ok too but we need to do null check before dereferencing the head of the list). Reviewed By: davidtgoldblatt Differential Revision: D17680391 fbshipit-source-id: a1d68997668077cc0b34cc66405628ed2f95702b
Showing
Please register or sign in to comment