Currently, this method is called once since the class is a singleton. The getInstance() of the singleton is synchronized so only 1 thread will be able to create the object the first time (and therefore call the startProcessingQueue method).
Once the manager class is separated from the queue class, this method would be synchronized.


From: mavarley [mailto:notifications@github.com]
Sent: Thursday, April 18, 2013 2:44 PM
To: securekey/openmidaas-android-lib
Subject: Re: [openmidaas-android-lib] Shipping and cc into endpoints dev branch (#4)


In library/src/org/openmidaas/library/common/WorkQueueManager.java:

> @@ -73,7 +75,7 @@ public void addWorkerToQueue(Worker worker) {

>       }

>

>       private void startProcessingQueue() {

does this need to be synchronized? currently 1 thread can enter the loop, another thread could execute 'terminate', and then thread 1 would wait() forever...

—
Reply to this email directly or view it on GitHub<https://github.com/securekey/openmidaas-android-lib/pull/4/files#r3860446>.