标签:锁
public static synchronized List<SignatureVerification> getVerifyListInfo(byte[] b) { List<SignatureVerification> signatureVerifications = new ArrayList<SignatureVerification>(); SignatureVerification sv = new SignatureVerification(); byte[] cert = null; SPDocument doc = new SPDocument(); cert = doc.VerifySignature(b); int i = doc.getVerifyResult(); logger.info("VerifyService---getVerifyResult:"+i); if (i == 0) { sv.setModified(false); } if (i == 1) { sv.setModified(true); } if (i == 2 || i == 3) { sv.setModified(true); } if (cert != null) { sv.setX509Base64(com.itrus.util.Base64.encode(cert)); signatureVerifications.add(sv); } return signatureVerifications; }
静态方法内调用的SO库,SO库里释放内存报错,所以加锁,多线程测试故障消除
标签:锁
原文地址:http://yjm199.blog.51cto.com/4408395/1954167