From a3278d5b9c7dfcff7bbe66b5fb3cc063667bee32 Mon Sep 17 00:00:00 2001 From: Patrick Fink Date: Fri, 5 May 2017 01:27:48 +0200 Subject: [PATCH] Fix multithreading issues in child handler creation and disposal (#9) --- .../org/openhab/binding/heos/handler/HeosBridgeHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openhab/binding/heos/handler/HeosBridgeHandler.java b/src/main/java/org/openhab/binding/heos/handler/HeosBridgeHandler.java index a6d5c658cfaa8..ce75a975c1c7f 100644 --- a/src/main/java/org/openhab/binding/heos/handler/HeosBridgeHandler.java +++ b/src/main/java/org/openhab/binding/heos/handler/HeosBridgeHandler.java @@ -219,7 +219,7 @@ public void dispose() { */ @Override - public void childHandlerInitialized(ThingHandler childHandler, Thing childThing) { + public synchronized void childHandlerInitialized(ThingHandler childHandler, Thing childThing) { handlerList.put(childThing.getUID(), childHandler); thingOnlineState.put(childThing.getUID(), ThingStatus.ONLINE); this.addPlayerChannel(childThing); @@ -235,7 +235,7 @@ public void childHandlerInitialized(ThingHandler childHandler, Thing childThing) */ @Override - public void childHandlerDisposed(ThingHandler childHandler, Thing childThing) { + public synchronized void childHandlerDisposed(ThingHandler childHandler, Thing childThing) { if (this.getThing().getStatus().equals(ThingStatus.OFFLINE)) { // Prevents to change channels if bridge is // offline.