Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Static method locking

Shulou Source: shulou.com Published: 2022-06-03 07:15:48 11月23日 Update

Public static synchronized List getVerifyListInfo (byte [] b) {List signatureVerifications = new ArrayList (); 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;}

The SO library called in the static method, and the SO library frees memory to report errors, so locks are added and multithreaded testing faults are eliminated.

Tags: Methods static memory failures threads libraries tests Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Information OPPO Reno MariaDB Docker