From 7f7b1910771968e0772f6c5d19f103e16b215700 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Thu, 28 Nov 2019 14:33:07 +0200 Subject: [PATCH] IOTSTOR-951: Unlock the master mutex even after garbage_collect() --- features/storage/kvstore/tdbstore/TDBStore.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/features/storage/kvstore/tdbstore/TDBStore.cpp b/features/storage/kvstore/tdbstore/TDBStore.cpp index 417a04deb07..61ce2797624 100644 --- a/features/storage/kvstore/tdbstore/TDBStore.cpp +++ b/features/storage/kvstore/tdbstore/TDBStore.cpp @@ -663,16 +663,15 @@ int TDBStore::set_finalize(set_handle_t handle) } end: - if ((need_gc) && (ih->bd_base_offset != _master_record_offset)) { - garbage_collection(); - } - // mark handle as invalid by clearing magic field in header ih->header.magic = 0; _inc_set_mutex.unlock(); if (ih->bd_base_offset != _master_record_offset) { + if (need_gc) { + garbage_collection(); + } _mutex.unlock(); } return ret;