}
private void initializeSpecifiedSampleData(final int[] indexes, final SampleRomNameProvisionMediator cb) {
//if (true)
// return;
ZWaitThread t = new ZBackgroundRemoterThread() {
public void run() {
try {
this.setName("SampleDataPass");
Integer sample;
RWLock sLock;
Object sobj;
for (int n = 0, o = indexes.length; n < o; n++) {
device.access();
try {
if (this.alive == false) {
return;
}
sample = IntPool.get(indexes[n]);
sLock = ((RWLock) s2sl.get(sample));
sLock.write();
try {
sobj = s2sobj.get(sample);
if (sobj != null && sobj instanceof UninitSampleObject) {
if (cb != null && cb.providesNames())
sobj = scf.initializeSampleAtIndex(sample, cb.getName(sample.intValue()), se_handler);
else
sobj = scf.initializeSampleAtIndex(sample, se_handler);
if (sobj == null)
continue;
s2sobj.put(sample, sobj);
se_handler.postSampleEvent(new SampleInitializeEvent(this, sample));
}
if (cb != null && sobj != null && cb.wantsNames())
cb.setName(sample.intValue(), sobj.toString());
} finally {
sLock.unlock();
}
} finally {
device.unlock();
}
// yield();
}
} finally {
if (cb != null)
cb.done();
}
}
};
workerThreads.add(t);
t.start();
}