Skip to content

Commit

Permalink
Make listeners of WaterRower thread-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
tbressler committed Feb 8, 2021
1 parent 5f6f298 commit 175c991
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/de/tbressler/waterrower/WaterRower.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

import static de.tbressler.waterrower.io.msg.out.ConfigureWorkoutMessage.MessageType.*;
import static de.tbressler.waterrower.model.ErrorCode.*;
Expand Down Expand Up @@ -57,7 +58,7 @@ public class WaterRower {
private final DeviceVerificationWatchdog deviceVerificationWatchdog;

/* All listeners. */
private List<IWaterRowerConnectionListener> listeners = new ArrayList<>();
private List<IWaterRowerConnectionListener> listeners = new CopyOnWriteArrayList<>();


/* The listener for the WaterRower connector. */
Expand Down

0 comments on commit 175c991

Please sign in to comment.