Merge pull request #570 from jotomo/queue-starts
Queue: synchronize creating queue thread to avoid multiple threads.
This commit is contained in:
commit
7b0a4d2ce7
1 changed files with 1 additions and 1 deletions
|
@ -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