From 60675db070c92e5475a89f5da54f2a2d3db718b2 Mon Sep 17 00:00:00 2001 From: "Mr. Chip" <36813506+mrchipset@users.noreply.github.com> Date: Fri, 10 May 2024 15:27:33 +0800 Subject: [PATCH] [fdb_kvdb] fix lock issue to fix block on first run (#295) --- src/fdb_kvdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fdb_kvdb.c b/src/fdb_kvdb.c index d6211f3..00cf557 100644 --- a/src/fdb_kvdb.c +++ b/src/fdb_kvdb.c @@ -1798,9 +1798,11 @@ fdb_err_t fdb_kvdb_init(fdb_kvdb_t db, const char *name, const char *path, struc #endif /* FDB_KV_USING_CACHE */ FDB_DEBUG("KVDB size is %" PRIu32 " bytes.\n", db_max_size(db)); - + db_unlock(db); + result = _fdb_kv_load(db); - + + db_lock(db); #ifdef FDB_KV_AUTO_UPDATE if (result == FDB_NO_ERR) { kv_auto_update(db);