ThreadExceptionHandler threadGroup = new ThreadExceptionHandler();
for (int i = 0; i < inserters; i++) {
if (sharedPC) { // each thread shares one PC
if (pc==null)
pc = new StateTransitionObj(i);
}
else { // each thread has its own PC
pc = new StateTransitionObj(i);
}
threads++;
Thread t = new Thread(threadGroup, new Inserter(pmf, pc, sharedPC));
t.setName("Inserter-" + i);
t.start();