On Mon, 15 Jul 2024 16:09:39 GMT, Kim Barrett <kbarr...@openjdk.org> wrote:
> > Aw, nice usability landmine. I thought C2 barrier set would assert on me if > > it cannot deliver. Apparently not, [...] > > Reference.refersTo has similar issues. See refersToImpl and refersTo0 in both > Reference and PhantomReference. I think you should be able to model on those > and the intrinsic implementation for refersTo to get what you want. > > One additional complication is that Reference.enqueue intentionally calls > clear0. If implementing clear similarly to refersTo, then enqueue should be > changed to call clearImpl. I should have read what I was replying to more carefully, rather than focusing on what was further up in the thread. Looks like you (@shipilev) already spotted the refersTo stuff. But the enqueue => clear0 could have easily been missed, so perhaps not an entirely unneeded suggestion. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20139#issuecomment-2231464762