Add thread-local caches for file locks and handles in fd_pool

This commit is contained in:
ImBenji
2025-12-04 20:18:58 +00:00
parent 55c69aebc2
commit 6e81375d7f

View File

@@ -0,0 +1,12 @@
#include "sweepstore/utils/file_lock.h"
#include "sweepstore/utils/file_handle.h"
// Thread-local FD cache definition for file locking
#ifndef _WIN32
thread_local std::unordered_map<std::string, int> SweepstoreFileLock::fdCache;
#endif
// Thread-local stream cache definition for file handles
#ifndef WITH_UNREAL
thread_local std::unordered_map<std::string, std::unique_ptr<std::fstream>> SweepstoreFileHandle::streamCache;
#endif