|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Retention(value=SOURCE) @Documented @Target(value=FIELD) public @interface CopyOnWrite
Represents fields that are protected for concurrency by the copy-on-write semantics.
Fields marked by this annotation always holds on to an immutable collection. A change to the collection must be done by first creating a new collection object, making changes, then replacing the reference atomically.
This allows code to access the field without synchronization, and greatly reduces the risk of dead-lock bugs.
The field marked with this annotation usually needs to be marked as volatile.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||