From 7e83f81a531a47f29c7bf828c56a38dcbf96f286 Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Tue, 19 May 2009 14:48:49 +0000
Subject: [PATCH] - attempt to fix possible race condition that might occur when scheduled task changes its state to done but hasnt transitioned to the completed tasks list yet.

---
 opends/src/server/org/opends/server/backends/task/TaskScheduler.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 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 45e0188..d66f9c2 100644
--- a/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
+++ b/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
@@ -620,17 +620,20 @@
    * @param  taskThread     The thread that has completed processing on its
    *                        previously-assigned task.
    * @param  completedTask  The task for which processing has been completed.
+   * @param  taskState      The task state for this completed task.
    *
    * @return  <CODE>true</CODE> if the thread should continue running and
    *          wait for the next task to process, or <CODE>false</CODE> if it
    *          should exit immediately.
    */
-  public boolean threadDone(TaskThread taskThread, Task completedTask)
+  public boolean threadDone(TaskThread taskThread, Task completedTask,
+    TaskState taskState)
   {
     schedulerLock.lock();
 
     try
     {
+      completedTask.setTaskState(taskState);
       addCompletedTask(completedTask);
 
       String taskID = completedTask.getTaskID();

--
Gitblit v1.10.0