You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2012/10/16 09:09:13 UTC
svn commit: r1398678 -
/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
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();