Merging forward updates from release/os/4.7 to release/os/4.8 - 2023-10-05

This commit is contained in:
r3-build 2023-10-05 10:17:26 +00:00
commit 4325131c27

View File

@ -76,8 +76,7 @@ public class SharedMemoryIncremental extends PortAllocation {
newValue = (oldValue + 1);
}
boolean reserveSuccess = UNSAFE.compareAndSwapLong(null, startingAddress, oldValue, newValue);
boolean portAvailable = isLocalPortAvailable(newValue);
loopSuccess = reserveSuccess && portAvailable;
loopSuccess = reserveSuccess && isLocalPortAvailable(newValue);
} while (!loopSuccess);
return (int) newValue;