Today I saw this utility class for AtomicEnum but I wonder if it is possible to have an atomic enum why it is not included in Java standard libraries? In fact I have so much doubt if it can be really atomic and if this utility class works.
The AtomicEnum class is this
- How can I examine if it does the operations atomically?
- Is there a tool for seeing the compiled code and be sure that it does really all in only one machine instruction?
- Is it possible to discover it from the code?
- So if this Atomic enum works, I can have an attribute AtomicEnum and it will be possible to use it safely without volatile keyword and synchronized getters and setters?