From 695efac57879b676d7d6d92d83811558b2dc0d67 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 02 Aug 2007 21:47:09 +0000
Subject: [PATCH] Fix a potential deadlock in the task code that could occur if a client tried to retrieve the task entry at the same time that it was being updated.

---
 opends/src/server/org/opends/server/backends/task/TaskScheduler.java |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/task/TaskScheduler.java b/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
index 6bdebcf..9160631 100644
--- a/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
+++ b/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
@@ -1468,6 +1468,19 @@
 
 
   /**
+   * Indicates whether the current thread already holds a lock on the scheduler.
+   *
+   * @return  {@code true} if the current thread holds the scheduler lock, or
+   *          {@code false} if not.
+   */
+  boolean holdsSchedulerLock()
+  {
+    return schedulerLock.isHeldByCurrentThread();
+  }
+
+
+
+  /**
    * Attempts to acquire a write lock on the specified entry, trying as many
    * times as necessary until the lock has been acquired.
    *

--
Gitblit v1.10.0