From 6e81375d7f4f5657511a77a35dae6cf61c24428d Mon Sep 17 00:00:00 2001 From: ImBenji Date: Thu, 4 Dec 2025 20:18:58 +0000 Subject: [PATCH] Add thread-local caches for file locks and handles in fd_pool --- cpp/src/Private/sweepstore/utils/fd_pool.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 cpp/src/Private/sweepstore/utils/fd_pool.cpp diff --git a/cpp/src/Private/sweepstore/utils/fd_pool.cpp b/cpp/src/Private/sweepstore/utils/fd_pool.cpp new file mode 100644 index 0000000..636722e --- /dev/null +++ b/cpp/src/Private/sweepstore/utils/fd_pool.cpp @@ -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 SweepstoreFileLock::fdCache; +#endif + +// Thread-local stream cache definition for file handles +#ifndef WITH_UNREAL +thread_local std::unordered_map> SweepstoreFileHandle::streamCache; +#endif