mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
16.49.2015 a5789e69cf5ecfff3234af5b81dfd5fc3de6d1e3
opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskBackend.java
@@ -35,7 +35,6 @@
import java.net.InetAddress;
import java.security.MessageDigest;
import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.zip.Deflater;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@@ -59,6 +58,7 @@
import org.opends.server.config.ConfigEntry;
import org.opends.server.core.*;
import org.opends.server.types.*;
import org.opends.server.types.LockManager.DNLock;
import org.opends.server.util.DynamicConstants;
import org.opends.server.util.LDIFException;
import org.opends.server.util.LDIFReader;
@@ -413,8 +413,7 @@
      return null;
    }
    Lock lock = taskScheduler.readLockEntry(entryDN);
    DNLock lock = taskScheduler.readLockEntry(entryDN);
    try
    {
      if (entryDN.equals(taskRootDN))
@@ -453,7 +452,7 @@
    }
    finally
    {
      taskScheduler.unlockEntry(entryDN, lock);
      lock.unlock();
    }
  }
@@ -584,11 +583,10 @@
      ModifyOperation modifyOperation) throws DirectoryException
  {
    DN entryDN = newEntry.getName();
    Lock entryLock = null;
    DNLock entryLock = null;
    if (! taskScheduler.holdsSchedulerLock())
    {
      entryLock = LockManager.lockWrite(entryDN);
      entryLock = DirectoryServer.getLockManager().tryWriteLockEntry(entryDN);
      if (entryLock == null)
      {
        throw new DirectoryException(ResultCode.BUSY,
@@ -707,7 +705,7 @@
    {
      if (entryLock != null)
      {
        LockManager.unlock(entryDN, entryLock);
        entryLock.unlock();
      }
    }
  }
@@ -868,8 +866,7 @@
      }
      else if (parentDN.equals(scheduledTaskParentDN))
      {
        Lock lock = taskScheduler.readLockEntry(baseDN);
        DNLock lock = taskScheduler.readLockEntry(baseDN);
        try
        {
          Entry e = taskScheduler.getScheduledTaskEntry(baseDN);
@@ -890,13 +887,12 @@
        }
        finally
        {
          taskScheduler.unlockEntry(baseDN, lock);
          lock.unlock();
        }
      }
      else if (parentDN.equals(recurringTaskParentDN))
      {
        Lock lock = taskScheduler.readLockEntry(baseDN);
        DNLock lock = taskScheduler.readLockEntry(baseDN);
        try
        {
          Entry e = taskScheduler.getRecurringTaskEntry(baseDN);
@@ -917,7 +913,7 @@
        }
        finally
        {
          taskScheduler.unlockEntry(baseDN, lock);
          lock.unlock();
        }
      }
      else