在读android的代码,其中有这样一段,不解
/**
* Retrieve a new Parcel object from the pool.
*/
public static Parcel obtain() {
[color=darkred] final Parcel[] pool = sOwnedPool;
synchronized (pool) { [/color]
Parcel p;
for (int i=0; i<POOL_SIZE; i++) {
p = pool[i];
if (p != null) {
pool[i] = null;
if (DEBUG_RECYCLE) {
p.mStack = new RuntimeException();
}
return p;
}
}
}
return new Parcel(0);
}
红字部分,为什么要局部一个数组,进行同步?