framlog commented on issue #12329:
URL: https://github.com/apache/arrow/issues/12329#issuecomment-1029665533


   You are right.  
   
   The fix that I give is to use 0 as an intermediate state(we set `pid_` to 0 
when we try to reset everything and then set `pid_` to the `current_pid_`). 
Other threads entering this block checks `old_pid != 0 && 
pid_.compare_exchange_strong(old_pid, 0)` to figure out whether they need to 
spin or not. (`old_pid` is the value read before we do the check).  At least it 
passes my local tests. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to