Remove locking from TypedefEffectiveStatementImpl 90/87490/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 6 Feb 2020 10:22:41 +0000 (11:22 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 6 Feb 2020 12:34:11 +0000 (13:34 +0100)
commit83e26239c77257a85ea74d855eb0921d857d8e6f
tree2fe3dd3a8e8899d9e55f7cd007d63ef9a9b48ff4
parentbbf971988a385a8df74cb99a3b8c668b1c9c559b
Remove locking from TypedefEffectiveStatementImpl

We are using lazy initialization of two fields using double-checked
locking. The objects that fill these slots do not have side-effects
and hence we can forgo the lock completely and perform atomic
operations -- in case of a conflict we will just throw away the
second object.

JIRA: YANGTOOLS-652
Change-Id: I4c48f756350cd61596cd5844e1684b9adcee3b48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/typedef/TypedefEffectiveStatementImpl.java