Skip to content

Commit

Permalink
[ROCKETMQ-261] Use write lock when destroy IndexService
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouxinyu committed Aug 11, 2017
1 parent f613c3b commit 332df78
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ private void deleteExpiredFile(List<IndexFile> files) {

public void destroy() {
try {
this.readWriteLock.readLock().lock();
this.readWriteLock.writeLock().lock();
for (IndexFile f : this.indexFileList) {
f.destroy(1000 * 3);
}
this.indexFileList.clear();
} catch (Exception e) {
log.error("destroy exception", e);
} finally {
this.readWriteLock.readLock().unlock();
this.readWriteLock.writeLock().unlock();
}
}

Expand Down

0 comments on commit 332df78

Please sign in to comment.