make onChange synchronized (#12205)

Signed-off-by: Eugen Freiter <freiter@gmx.de>

Co-authored-by: Eugen Freiter <freiter@gmx.de>
This commit is contained in:
eugen 2022-02-05 08:39:17 +01:00 committed by GitHub
parent 73b805b115
commit fde78b3fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -291,8 +291,8 @@ public class HomekitImpl implements Homekit, NetworkAddressChangeListener {
}
@Override
public void onChanged(final List<CidrAddress> added, final List<CidrAddress> removed) {
logger.trace("restarting HomeKit bridge on network interface changes.");
public synchronized void onChanged(final List<CidrAddress> added, final List<CidrAddress> removed) {
logger.trace("HomeKit bridge reacting on network interface changes.");
removed.forEach(i -> {
logger.trace("removed interface {}", i.getAddress().toString());
if (i.getAddress().equals(networkInterface)) {