mirror of
https://github.com/corda/corda.git
synced 2024-12-24 07:06:44 +00:00
Don't bind unless shared memory says it is free (#7520)
This commit is contained in:
parent
bae84b3c63
commit
3cdb8901b4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user