Implement DebugDB (#166)

This commit is contained in:
Jae Kwon
2018-03-18 01:52:28 +01:00
committed by GitHub
parent 3412587036
commit b0e0dc5de3
6 changed files with 239 additions and 15 deletions

View File

@ -45,9 +45,10 @@ func (mBatch *memBatch) WriteSync() {
}
func (mBatch *memBatch) write(doSync bool) {
mtx := mBatch.db.Mutex()
mtx.Lock()
defer mtx.Unlock()
if mtx := mBatch.db.Mutex(); mtx != nil {
mtx.Lock()
defer mtx.Unlock()
}
for i, op := range mBatch.ops {
if doSync && i == (len(mBatch.ops)-1) {