boolean flag = pcSystem.returnTenderResult(bidDocu,tenderDocu);
我在自定义pcSystem类中调用一个具有boolean返回值的函数returnTenderResult(synchronized)
这条语句的上一条语句都会执行,而returnTenderResult内方法一定概率上不执行
(方法内的第一条语句都没有执行,还不涉及方法内具体逻辑),系统涉及了多线程,
这是为什么啊
public synchronized boolean reviewOtherCommForhelpTask(BidDocu bidDocu,TenderDocu tenderDocu) throws IOException{//评审其他社区寻求帮助任务的时间及资源
boolean flag = false;
// ====================================
Date nowDate = new Date();
String log = "reviewOtherComm,当前用时"+(nowDate.getTime()-TimerManager.getTimerStamp()[0])+
"ms"+System.getProperty("line.separator");
TakeNotes.recordLogs(commid, log);
// ====================================
if(bidDocu.getFid()<=CommMessageManager.pcFid){
//PC
// ====================================
nowDate = new Date();
log = "check Pc Task,当前用时"+(nowDate.getTime()-TimerManager.getTimerStamp()[0])+
"ms"+System.getProperty("line.separator");
TakeNotes.recordLogs(commid, log);
// ====================================
flag = pcSystem.returnTenderResult(bidDocu,tenderDocu);
}else {
//Robot
// ====================================
nowDate = new Date();
log = "check Robot Task,当前用时"+(nowDate.getTime()-TimerManager.getTimerStamp()[0])+
"ms"+System.getProperty("line.separator");
TakeNotes.recordLogs(commid, log);
// ====================================
flag = robotSystem.returnTenderResult(bidDocu,tenderDocu);
}
return flag;
}
public synchronized boolean returnTenderResult(BidDocu forHelpBidDocu,TenderDocu tenderDocu) throws IOException{
Date nowDate = new Date();
String log;
boolean flag = false;
// =================================
nowDate = new Date();
log = "returnTenderResult,当前时间"+
(nowDate.getTime()-TimerManager.getTimerStamp()[0])+"ms"+
System.getProperty("line.separator");
TakeNotes.recordLogs(commid,log);
// =================================
}