Changeset View
Changeset View
Standalone View
Standalone View
src/util/system.cpp
Show First 20 Lines • Show All 772 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static fs::path g_blocks_path_cache_net_specific; | static fs::path g_blocks_path_cache_net_specific; | ||||
static fs::path pathCached; | static fs::path pathCached; | ||||
static fs::path pathCachedNetSpecific; | static fs::path pathCachedNetSpecific; | ||||
static CCriticalSection csPathCached; | static CCriticalSection csPathCached; | ||||
const fs::path &GetBlocksDir() { | const fs::path &GetBlocksDir() { | ||||
LOCK(csPathCached); | LOCK(csPathCached); | ||||
fs::path &path = g_blocks_path_cache_net_specific; | fs::path &path = g_blocks_path_cache_net_specific; | ||||
// This can be called during exceptions by LogPrintf(), so we cache the | // This can be called during exceptions by LogPrintf(), so we cache the | ||||
// value so we don't have to do memory allocations after that. | // value so we don't have to do memory allocations after that. | ||||
if (!path.empty()) { | if (!path.empty()) { | ||||
return path; | return path; | ||||
▲ Show 20 Lines • Show All 561 Lines • Show Last 20 Lines |