Use compareAndExchange() to set closeFuture 76/109276/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 9 Dec 2023 10:51:14 +0000 (11:51 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 10 Dec 2023 10:46:03 +0000 (11:46 +0100)
commitc6feabfb3c9b78cc447be1066d4db9b120fdea85
tree741b3cf881466d446000eea621eb83ca8041bbb8
parentd4cf23748f9fa863f27fcf877030bc2398bba47d
Use compareAndExchange() to set closeFuture

Java 9+ gives us a convenient way to ensure null-safety in this CAS
operation -- compareAndExchange() returns the witness value, i.e.
we get the value instead of a plain boolean false.

Change-Id: I636b0f084170d42bbd99490577917afefe5145e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b61b30a4b2be38c8629bf9c5d66d05609db3be1c)
(cherry picked from commit aebfa4e09d2b35c8da3fb88d8a5883d84dab6b11)
singleton-service/mdsal-singleton-dom-impl/src/main/java/org/opendaylight/mdsal/singleton/dom/impl/ClusterSingletonServiceGroupImpl.java