Skip to content

Commit 04e26e9

Browse files
authored
Merge pull request #5495 from vpodzime/3.18.x-lmdb_close_lockfile
[3.18.x] Try to acquire file lock when closing DB
2 parents fd690db + 009e814 commit 04e26e9

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
@@ -525,8 +525,14 @@ void CloseDB(DBHandle *handle)
525525
handle->refcount--;
526526
if (handle->refcount == 0)
527527
{
528+
FileLock lock = EMPTY_FILE_LOCK;
529+
bool locked = DBPathLock(&lock, handle->filename);
528530
DBPrivCloseDB(handle->priv);
529531
handle->open_tstamp = -1;
532+
if (locked)
533+
{
534+
DBPathUnLock(&lock);
535+
}
530536
}
531537
}
532538

0 commit comments

Comments
 (0)