我有以下方法:
var article2 = article2.split(/(?=[A-Z][a-z])/);
我希望主类等待线程完成所有记录的处理,然后返回// Main Class:
processRecords(ArrayList<String> records) {
Boolean isSuccess = false;
ProcessRecordThread thread = new ProcessRecordThread(records);
new Thread(thread).start();
return isSuccess;
}
// Thread class:
run() {
for (String record : records) {
try {
process(record);
} catch (Exception e) {
isSuccess = false;
}
}
}
变量并继续执行主类。