on-internet
← Community

VarHandle get/setOpaque

Stack Overflow ·

I keep fighting to understand what VarHandle::setOpaque and VarHandle::getOpaque are really doing. It has not been easy so far - there are some things I think I get (but will not present them in the question itself, not to muddy the waters), but overall this is miss-leading at best for me. The documentation: Returns the value of a variable, accessed in program order... Well in my understanding if I have: int xx = x; // read x int yy = y; // read y These reads can be re-ordered. On the other had if I have: // simplified code, does not compile, but reads happen on the same "this" for example int

Comments

Sign in or sign up to comment and upvote.

No comments yet.