Add thread-local caches for file locks and handles in fd_pool
This commit is contained in:
12
cpp/src/Private/sweepstore/utils/fd_pool.cpp
Normal file
12
cpp/src/Private/sweepstore/utils/fd_pool.cpp
Normal 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
|
||||
Reference in New Issue
Block a user