Open 1316151417 opened 5 years ago
reset CountDownLatch at method prepare(), code : private synchronized void prepare() { ...... syncPoint = new CountDownLatch(1); }
private synchronized void prepare() { ...... syncPoint = new CountDownLatch(1); }
Allow it to be null, code : private void cleanup() { if(currentNode != null) { //delete currentNode.... } ...... }
private void cleanup() { if(currentNode != null) { //delete currentNode.... } ...... }
Interrupt thread after get lock, CountDownLatch is not reset while lock at the next time
reset CountDownLatch at method prepare(), code :
private synchronized void prepare() { ...... syncPoint = new CountDownLatch(1); }
Interrupt thread after get lock, the field currentNode is null, cleanup will throw NullPointException
Allow it to be null, code :
private void cleanup() { if(currentNode != null) { //delete currentNode.... } ...... }