[ROCKETMQ-261] Use write lock when destroy IndexService

This commit is contained in:
yukon
2017-08-11 22:17:32 +08:00
parent f613c3b7df
commit 332df78e2b
@@ -142,7 +142,7 @@ public class IndexService {
public void destroy() {
try {
this.readWriteLock.readLock().lock();
this.readWriteLock.writeLock().lock();
for (IndexFile f : this.indexFileList) {
f.destroy(1000 * 3);
}
@@ -150,7 +150,7 @@ public class IndexService {
} catch (Exception e) {
log.error("destroy exception", e);
} finally {
this.readWriteLock.readLock().unlock();
this.readWriteLock.writeLock().unlock();
}
}