mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-12 06:08:25 -05:00
Eliminate race condition which causes multiple connections to IDLE
simultaneously
This commit is contained in:
parent
ee463b32ff
commit
694ba471d4
@ -33,6 +33,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@ -2012,15 +2013,18 @@ public class ImapStore extends Store {
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.i(Email.LOG_TAG, "About to IDLE for " + getLogId());
|
||||
|
||||
receiver.setPushActive(getName(), true);
|
||||
idling.set(true);
|
||||
doneSent.set(false);
|
||||
executeSimpleCommand("IDLE", false, ImapFolderPusher.this);
|
||||
idling.set(false);
|
||||
receiver.setPushActive(getName(), false);
|
||||
delayTime.set(NORMAL_DELAY_TIME);
|
||||
if (stop.get() != true)
|
||||
{
|
||||
Log.i(Email.LOG_TAG, "About to IDLE for " + getLogId());
|
||||
|
||||
receiver.setPushActive(getName(), true);
|
||||
idling.set(true);
|
||||
doneSent.set(false);
|
||||
executeSimpleCommand("IDLE", false, ImapFolderPusher.this);
|
||||
idling.set(false);
|
||||
receiver.setPushActive(getName(), false);
|
||||
delayTime.set(NORMAL_DELAY_TIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
Loading…
Reference in New Issue
Block a user