Merge pull request #570 from jotomo/queue-starts
Queue: synchronize creating queue thread to avoid multiple threads.
This commit is contained in:
commit
7b0a4d2ce7
|
@ -128,7 +128,7 @@ public class CommandQueue {
|
||||||
|
|
||||||
// After new command added to the queue
|
// After new command added to the queue
|
||||||
// start thread again if not already running
|
// start thread again if not already running
|
||||||
private void notifyAboutNewCommand() {
|
private synchronized void notifyAboutNewCommand() {
|
||||||
if (thread == null || thread.getState() == Thread.State.TERMINATED) {
|
if (thread == null || thread.getState() == Thread.State.TERMINATED) {
|
||||||
thread = new QueueThread(this);
|
thread = new QueueThread(this);
|
||||||
thread.start();
|
thread.start();
|
||||||
|
|
Loading…
Reference in a new issue