...
| Wiki Markup |
|---|
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="b64eaecce86c8f83-902b06e2-4cb943eb-a45b9b59-f9edec894992f23d48d1907f"><ac:parameter ac:name="">CON03-EX1</ac:parameter></ac:structured-macro> *CON03-EX1:* It is permissible to start a background thread during class initialization provided the thread does not access any fields. For example, the {{ObjectPreserver}} class (based on \[[Patterns 02|AA. Java References#Patterns 02]\]) shown below provides a mechanism for storing object references, which prevents an object from being garbage-collected, even if the object is not dereferenced in the future. |
...
CON02-J. Do not synchronize on objects that may be reused 11. Concurrency (CON) CON04CON07-J. Use private final lock objects to synchronize classes that may interact with untrusted code