On Fri, 7 Feb 2025 07:58:47 GMT, Michael Strauß <mstra...@openjdk.org> wrote:
> What's the rationale for using a borrow pattern here, instead of simply > synchronizing access to the object in question? A very good question! This pattern seemed to be the most applicable here: the solution needs to be both thread-safe and reentrant, with the expectation that in most cases the simple scenario happens where the static instance is used. We actually use that pattern using synchronization, see `GlyphLayout::getInstance()` for example. I think the use of AtomicBoolean is far better, so I took the same approach in #1667 . Is there a specific scenario that would not work or cause issues? ------------- PR Comment: https://git.openjdk.org/jfx/pull/1691#issuecomment-2643323226