Skip to content

Commit 3d9991b

Browse files
authored
Merge pull request #5492 from vpodzime/master-lmdb_close_lockfile
Try to acquire file lock when closing DB
2 parents 28be128 + f6e9948 commit 3d9991b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libpromises/dbm_api.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,14 @@ void CloseDB(DBHandle *handle)
526526
handle->refcount--;
527527
if (handle->refcount == 0)
528528
{
529+
FileLock lock = EMPTY_FILE_LOCK;
530+
bool locked = DBPathLock(&lock, handle->filename);
529531
DBPrivCloseDB(handle->priv);
530532
handle->open_tstamp = -1;
533+
if (locked)
534+
{
535+
DBPathUnLock(&lock);
536+
}
531537
}
532538
}
533539

0 commit comments

Comments
 (0)