Is it possible that before list.key got updated later on in list.init, somebody already tried to grab that PL from gotomic hash? Do we need to acquire a lock on tmp or leave it to downstream users to be careful? Or add to lhmap only after l.init returns.
This is not a bug as we discussed. The struct uses locks before any internal fields are accessed, but because you’re in the same package, you’re able to access the internal field. You should acquire proper locks before using internal fields.