Queue: synchronize creating queue thread to avoid multiple threads.

This commit is contained in:
Johannes Mockenhaupt 2017-12-29 16:36:19 +01:00
parent bd4e51e1f9
commit facdc51f6f
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -128,7 +128,7 @@ public class CommandQueue {
// After new command added to the queue
// start thread again if not already running
private void notifyAboutNewCommand() {
private synchronized void notifyAboutNewCommand() {
if (thread == null || thread.getState() == Thread.State.TERMINATED) {
thread = new QueueThread(this);
thread.start();