| 422 | } |
| 423 | |
| 424 | void BerkeleyEnvironment::ReloadDbEnv() |
| 425 | { |
| 426 | // Make sure that no Db's are in use |
| 427 | AssertLockNotHeld(cs_db); |
| 428 | std::unique_lock<RecursiveMutex> lock(cs_db); |
| 429 | m_db_in_use.wait(lock, [this](){ |
| 430 | for (auto& db : m_databases) { |
| 431 | if (db.second.get().m_refcount > 0) return false; |
| 432 | } |
| 433 | return true; |
| 434 | }); |
| 435 | |
| 436 | std::vector<std::string> filenames; |
| 437 | for (auto it : m_databases) { |
| 438 | filenames.push_back(it.first); |
| 439 | } |
| 440 | // Close the individual Db's |
| 441 | for (const std::string& filename : filenames) { |
| 442 | CloseDb(filename); |
| 443 | } |
| 444 | // Reset the environment |
| 445 | Flush(true); // This will flush and close the environment |
| 446 | Reset(); |
| 447 | bilingual_str open_err; |
| 448 | Open(open_err); |
| 449 | } |
| 450 | |
| 451 | bool BerkeleyDatabase::Rewrite(const char* pszSkip) |
| 452 | { |
no test coverage detected