Skip to content

Commit e32826d

Browse files
committed
guards on neopixel start
1 parent dd9306d commit e32826d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/org/myrobotlab/service/NeoPixel.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,13 @@ public void run() {
177177

178178
// FIXME - this should just wait/notify - not start a thread
179179
public synchronized void start() {
180-
running = false;
181-
thread = new Thread(this, String.format("%s-animation-runner", getName()));
182-
thread.start();
180+
if (thread == null) {
181+
running = true;
182+
thread = new Thread(this, String.format("%s-animation-runner", getName()));
183+
thread.start();
184+
} else {
185+
log.info("animation runner already running");
186+
}
183187
}
184188

185189
public synchronized void stop() {

0 commit comments

Comments
 (0)