Revert "mdbx: proper atomic close (#827)"

This reverts commit 493ae8b083.
This commit is contained in:
alex.sharov 2023-01-10 13:20:01 +07:00
parent 493ae8b083
commit 8f3178f2f2

View File

@ -431,9 +431,10 @@ func (db *MdbxKV) openDBIs(buckets []string) error {
// Close closes db
// All transactions must be closed before closing the database.
func (db *MdbxKV) Close() {
if db.closed.CompareAndSwap(false, true) {
if db.closed.Load() {
return
}
db.closed.Store(true)
db.wg.Wait()
db.env.Close()
db.env = nil