Merge pull request #570 from jotomo/queue-starts

Queue: synchronize creating queue thread to avoid multiple threads.
This commit is contained in:
Milos Kozak 2017-12-31 09:27:27 +01:00 committed by GitHub
commit 7b0a4d2ce7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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();