b/2317194 Synchronize command queue to prevent ConcurrentModificationException from happening

Change-Id: I724fc8fd07d33cfa6e68221a766754dcb1f6aeba
This commit is contained in:
Michael Chan
2009-12-09 17:32:58 -08:00
parent 146385663b
commit 792edfcf12

View File

@@ -142,10 +142,10 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
private static LinkedList<BluetoothJob> workQueue = new LinkedList<BluetoothJob>();
private void queueCommand(BluetoothJob job) {
if (D) {
Log.d(TAG, workQueue.toString());
}
synchronized (workQueue) {
if (D) {
Log.d(TAG, workQueue.toString());
}
boolean processNow = pruneQueue(job);
// Add job to queue