1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-04 08:35:08 -05:00

Finish removing the ThreadPool / ExecutorService Left over from when the

code was actually in the view class
This commit is contained in:
Jesse Vincent 2010-08-10 04:29:18 +00:00
parent 490ab6b8c0
commit 9ebf16e3d9

View File

@ -18,8 +18,6 @@ import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.PriorityBlockingQueue; import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -139,8 +137,6 @@ public class MessagingController implements Runnable
ConcurrentHashMap<Account, Pusher> pushers = new ConcurrentHashMap<Account, Pusher>(); ConcurrentHashMap<Account, Pusher> pushers = new ConcurrentHashMap<Account, Pusher>();
private final ExecutorService threadPool = Executors.newFixedThreadPool(5);
public enum SORT_TYPE public enum SORT_TYPE
{ {
SORT_DATE(R.string.sort_earliest_first, R.string.sort_latest_first, false), SORT_DATE(R.string.sort_earliest_first, R.string.sort_latest_first, false),
@ -402,7 +398,7 @@ public class MessagingController implements Runnable
*/ */
public void listFolders(final Account account, final boolean refreshRemote, final MessagingListener listener) public void listFolders(final Account account, final boolean refreshRemote, final MessagingListener listener)
{ {
threadPool.execute(new Runnable() new Thread (new Runnable()
{ {
public void run() public void run()
{ {
@ -458,7 +454,7 @@ public class MessagingController implements Runnable
l.listFoldersFinished(account); l.listFoldersFinished(account);
} }
} }
}); }).start();
} }
private void doRefreshRemote(final Account account, MessagingListener listener) private void doRefreshRemote(final Account account, MessagingListener listener)
@ -558,13 +554,13 @@ public class MessagingController implements Runnable
*/ */
public void listLocalMessages(final Account account, final String folder, final MessagingListener listener) public void listLocalMessages(final Account account, final String folder, final MessagingListener listener)
{ {
threadPool.execute(new Runnable() new Thread(new Runnable()
{ {
public void run() public void run()
{ {
listLocalMessagesSynchronous(account, folder, listener); listLocalMessagesSynchronous(account, folder, listener);
} }
}); }).start();
} }
@ -700,7 +696,7 @@ public class MessagingController implements Runnable
+ ")"); + ")");
} }
threadPool.execute(new Runnable() new Thread(new Runnable()
{ {
public void run() public void run()
{ {
@ -892,7 +888,7 @@ public class MessagingController implements Runnable
listener.searchStats(stats); listener.searchStats(stats);
} }
} }
}); }).start();
} }
public void loadMoreMessages(Account account, String folder, MessagingListener listener) public void loadMoreMessages(Account account, String folder, MessagingListener listener)