On Fri, 15 Nov 2024 10:11:38 GMT, Francesco Nigro <d...@openjdk.org> wrote:
> ...in case having a lock-free structure can be of any help, in JCTools we > have... We should continue to lock the same lock in `insert()` and `remove()`, as it creates the _happens-before_ between the thread registering the `Cleaner`, and the Cleaner's thread, per [Cleaner.register](https://download.java.net/java/early_access/jdk24/docs/api/java.base/java/lang/ref/Cleaner.html#register(java.lang.Object,java.lang.Runnable)): > Actions in a thread prior to calling Cleaner.register() _happen-before_ the > cleaning action is run by the Cleaner's thread. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22043#issuecomment-2479688813