directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1398678 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Date Tue, 16 Oct 2012 07:09:13 GMT
Author: kayyagari
Date: Tue Oct 16 07:09:13 2012
New Revision: 1398678

URL: http://svn.apache.org/viewvc?rev=1398678&view=rev
Log:
stop the worker thread first

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1398678&r1=1398677&r2=1398678&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Tue Oct 16 07:09:13 2012
@@ -1321,6 +1321,29 @@ public class DefaultDirectoryService imp
         }
 
         // --------------------------------------------------------------------
+        // Shutdown the sync thread
+        // --------------------------------------------------------------------
+        if ( workerThread != null )
+        {
+            worker.stop = true;
+
+            synchronized ( worker.lock )
+            {
+                worker.lock.notify();
+            }
+
+            while ( workerThread.isAlive() )
+            {
+                LOG.info( "Waiting for SynchWorkerThread to die." );
+                workerThread.join( 500 );
+            }
+        }
+        else
+        {
+            partitionNexus.sync();
+        }
+
+        // --------------------------------------------------------------------
         // Shutdown the changelog
         // --------------------------------------------------------------------
         changeLog.sync();
@@ -1338,29 +1361,9 @@ public class DefaultDirectoryService imp
         // Shutdown the partition
         // --------------------------------------------------------------------
 
-        partitionNexus.sync();
         partitionNexus.destroy();
 
         // --------------------------------------------------------------------
-        // Shutdown the sync thread
-        // --------------------------------------------------------------------
-        if ( workerThread != null )
-        {
-            worker.stop = true;
-
-            synchronized ( worker.lock )
-            {
-                worker.lock.notify();
-            }
-
-            while ( workerThread.isAlive() )
-            {
-                LOG.info( "Waiting for SynchWorkerThread to die." );
-                workerThread.join( 500 );
-            }
-        }
-
-        // --------------------------------------------------------------------
         // And shutdown the server
         // --------------------------------------------------------------------
         cacheService.destroy();



Mime
View raw message