Skip to content

Commit

Permalink
fixup dummy lock
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Aug 14, 2022
1 parent 8d4299b commit 05638e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/libtorrent/aux_/pread_storage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ namespace libtorrent::aux {
mutable typed_bitfield<file_index_t> m_file_created;

bool m_allocate_files;

#if TORRENT_HAVE_MAP_VIEW_OF_FILE
std::shared_ptr<std::mutex> m_dummy_lock;
#endif
};

}
Expand Down
5 changes: 4 additions & 1 deletion src/pread_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::mutex>())
#endif
{
if (params.mapped_files) m_mapped_files = std::make_unique<file_storage>(*params.mapped_files);

Expand Down Expand Up @@ -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<std::mutex>()
, m_dummy_lock
#endif
);
}
Expand Down

0 comments on commit 05638e5

Please sign in to comment.