mirror of https://github.com/ledisdb/ledisdb.git
bitmap unlock bugfix
This commit is contained in:
parent
882e20a3e3
commit
d94f4629c2
|
@ -506,6 +506,7 @@ func (db *DB) BSetBit(key []byte, offset int32, val uint8) (ori uint8, err error
|
||||||
if setBit(segment, off, val) {
|
if setBit(segment, off, val) {
|
||||||
t := db.binBatch
|
t := db.binBatch
|
||||||
t.Lock()
|
t.Lock()
|
||||||
|
defer t.Unlock()
|
||||||
|
|
||||||
t.Put(bk, segment)
|
t.Put(bk, segment)
|
||||||
if _, _, e := db.bUpdateMeta(t, key, seq, off); e != nil {
|
if _, _, e := db.bUpdateMeta(t, key, seq, off); e != nil {
|
||||||
|
@ -514,7 +515,6 @@ func (db *DB) BSetBit(key []byte, offset int32, val uint8) (ori uint8, err error
|
||||||
}
|
}
|
||||||
|
|
||||||
err = t.Commit()
|
err = t.Commit()
|
||||||
t.Unlock()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue