tsan fix: rpc.wallet_destroy (#2615)

This commit is contained in:
cryptocode 2020-03-04 12:11:25 +01:00 committed by GitHub
commit 6c011e9656
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -380,7 +380,9 @@ void nano::wallet_store::initialize (nano::transaction const & transaction_a, bo
{
debug_assert (strlen (path_a.c_str ()) == path_a.size ());
auto error (0);
error |= mdb_dbi_open (tx (transaction_a), path_a.c_str (), MDB_CREATE, &handle);
MDB_dbi handle_l;
error |= mdb_dbi_open (tx (transaction_a), path_a.c_str (), MDB_CREATE, &handle_l);
handle = handle_l;
init_a = error != 0;
}

View file

@ -110,7 +110,7 @@ public:
static size_t const seed_iv_index;
static int const special_count;
nano::kdf & kdf;
MDB_dbi handle{ 0 };
std::atomic<MDB_dbi> handle{ 0 };
std::recursive_mutex mutex;
private: