mirror of
https://github.com/gogrlx/bitcask.git
synced 2026-04-17 10:35:16 -07:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c0c0b5369a | |||
| 720f03c6c2 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -1,6 +1,18 @@
|
|||||||
|
|
||||||
|
<a name="v0.3.9"></a>
|
||||||
|
## [v0.3.9](https://github.com/prologic/bitcask/compare/v0.3.8...v0.3.9) (2020-11-17)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Fix a race condition around .Close() and .Sync()
|
||||||
|
|
||||||
|
|
||||||
<a name="v0.3.8"></a>
|
<a name="v0.3.8"></a>
|
||||||
## [v0.3.8](https://github.com/prologic/bitcask/compare/v0.3.7...v0.3.8) (0001-01-01)
|
## [v0.3.8](https://github.com/prologic/bitcask/compare/v0.3.7...v0.3.8) (2020-11-17)
|
||||||
|
|
||||||
|
### Updates
|
||||||
|
|
||||||
|
* Update CHANGELOG for v0.3.8
|
||||||
|
|
||||||
|
|
||||||
<a name="v0.3.7"></a>
|
<a name="v0.3.7"></a>
|
||||||
|
|||||||
@@ -87,7 +87,10 @@ func (b *Bitcask) Stats() (stats Stats, err error) {
|
|||||||
// Close() as this is the only way to cleanup the lock held by the open
|
// Close() as this is the only way to cleanup the lock held by the open
|
||||||
// database.
|
// database.
|
||||||
func (b *Bitcask) Close() error {
|
func (b *Bitcask) Close() error {
|
||||||
|
b.mu.RLock()
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
|
b.mu.RUnlock()
|
||||||
b.Flock.Unlock()
|
b.Flock.Unlock()
|
||||||
os.Remove(b.Flock.Path())
|
os.Remove(b.Flock.Path())
|
||||||
}()
|
}()
|
||||||
@@ -107,6 +110,8 @@ func (b *Bitcask) Close() error {
|
|||||||
|
|
||||||
// Sync flushes all buffers to disk ensuring all data is written
|
// Sync flushes all buffers to disk ensuring all data is written
|
||||||
func (b *Bitcask) Sync() error {
|
func (b *Bitcask) Sync() error {
|
||||||
|
b.mu.RLock()
|
||||||
|
defer b.mu.RUnlock()
|
||||||
return b.curr.Sync()
|
return b.curr.Sync()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user