Skip to content

Commit

Permalink
Merge pull request openhab#14 from pfink/master
Browse files Browse the repository at this point in the history
Fix multithreading issues in child handler creation and disposal (openhab#9)
  • Loading branch information
Wire82 authored May 6, 2017
2 parents 59fc4ab + a3278d5 commit a79dfc0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.
Expand Down

0 comments on commit a79dfc0

Please sign in to comment.