From 05638e50834fc96a3423c1e6f830d7c45b8dcdc4 Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 15 Aug 2022 00:36:16 +0200 Subject: [PATCH] fixup dummy lock --- include/libtorrent/aux_/pread_storage.hpp | 4 ++++ src/pread_storage.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/libtorrent/aux_/pread_storage.hpp b/include/libtorrent/aux_/pread_storage.hpp index e1a92c377f5..4a8c797257c 100644 --- a/include/libtorrent/aux_/pread_storage.hpp +++ b/include/libtorrent/aux_/pread_storage.hpp @@ -167,6 +167,10 @@ namespace libtorrent::aux { mutable typed_bitfield m_file_created; bool m_allocate_files; + +#if TORRENT_HAVE_MAP_VIEW_OF_FILE + std::shared_ptr m_dummy_lock; +#endif }; } diff --git a/src/pread_storage.cpp b/src/pread_storage.cpp index f503bff5df7..1b74c7a57c0 100644 --- a/src/pread_storage.cpp +++ b/src/pread_storage.cpp @@ -78,6 +78,9 @@ namespace { , m_part_file_name("." + to_hex(params.info_hash) + ".parts") , m_pool(pool) , m_allocate_files(params.mode == storage_mode_allocate) +#if TORRENT_HAVE_MAP_VIEW_OF_FILE + , m_dummy_lock(std::make_shared()) +#endif { if (params.mapped_files) m_mapped_files = std::make_unique(*params.mapped_files); @@ -755,7 +758,7 @@ namespace { return m_pool.open_file(storage_index(), m_save_path, file , files(), mode #if TORRENT_HAVE_MAP_VIEW_OF_FILE - , std::shared_ptr() + , m_dummy_lock #endif ); }