nfsantos commented on PR #2457: URL: https://github.com/apache/jackrabbit-oak/pull/2457#issuecomment-3204434509
> > I believe this can happen, but returning from within the block will not prevent this from happening. Unless there's something about putting the return there that makes it more likely that thread 1 will leave the synchronized block faster. Or maybe non-determinism in the tests. The solution with AtomicReference should not have the problem described above. > > It's possible that I borrowed this from Guava's implementation without checking whether it is needed. Oh, I see. I would still prefer to understand why the extra return statement is needed, but ok, I guess we can trust the Guava approach. -- 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: oak-dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org