From b5914b55289553a3eac46cbdbb5bb5a17ecc0541 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 31 Oct 2003 10:56:03 +0000 Subject: [PATCH] *** empty log message *** --- include/libtorrent/storage.hpp | 2 +- include/libtorrent/torrent.hpp | 2 +- src/session.cpp | 2 +- src/storage.cpp | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/libtorrent/storage.hpp b/include/libtorrent/storage.hpp index 265d58a6a..91db3256a 100755 --- a/include/libtorrent/storage.hpp +++ b/include/libtorrent/storage.hpp @@ -147,7 +147,7 @@ namespace libtorrent void initialize_pieces(torrent* t, const boost::filesystem::path& path, detail::piece_checker_data* data, - boost::mutex* mutex); + boost::mutex& mutex); int bytes_left() const { return m_bytes_left; } diff --git a/include/libtorrent/torrent.hpp b/include/libtorrent/torrent.hpp index 0b63db4ae..d93fb453e 100755 --- a/include/libtorrent/torrent.hpp +++ b/include/libtorrent/torrent.hpp @@ -101,7 +101,7 @@ namespace libtorrent void print(std::ostream& os) const; void allocate_files(detail::piece_checker_data* data, - boost::mutex* mutex, + boost::mutex& mutex, const std::string& save_path) { m_storage.initialize_pieces(this, save_path, data, mutex); diff --git a/src/session.cpp b/src/session.cpp index 4af661651..11910a636 100755 --- a/src/session.cpp +++ b/src/session.cpp @@ -105,7 +105,7 @@ namespace libtorrent try { - t->torrent_ptr->allocate_files(t, &m_mutex, t->save_path); + t->torrent_ptr->allocate_files(t, m_mutex, t->save_path); // lock the session to add the new torrent boost::mutex::scoped_lock l(m_mutex); diff --git a/src/storage.cpp b/src/storage.cpp index fa162d69e..fff10d991 100755 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -333,7 +333,7 @@ bool libtorrent::storage::verify_piece(piece_file& file) void libtorrent::storage::initialize_pieces(torrent* t, const boost::filesystem::path& path, detail::piece_checker_data* data, - boost::mutex* mutex) + boost::mutex& mutex) { m_save_path = path; m_torrent_file = &t->torrent_file(); @@ -452,7 +452,7 @@ void libtorrent::storage::initialize_pieces(torrent* t, left_to_write -= chunksize; progress += chunksize; - boost::mutex::scoped_lock l(*mutex); + boost::mutex::scoped_lock l(mutex); data->progress = static_cast(progress) / total_bytes; if (data->abort) return; } @@ -460,7 +460,7 @@ void libtorrent::storage::initialize_pieces(torrent* t, if (left_to_write > 0) f.write(zeros, left_to_write); progress += left_to_write; - boost::mutex::scoped_lock l(*mutex); + boost::mutex::scoped_lock l(mutex); data->progress = static_cast(progress) / total_bytes; if (data->abort) return; } @@ -484,7 +484,7 @@ void libtorrent::storage::initialize_pieces(torrent* t, // std::cout << i+1 << " / " << m_torrent_file->num_pieces() << " missing: " << missing << "\r"; progress += m_torrent_file->piece_size(i); - boost::mutex::scoped_lock l(*mutex); + boost::mutex::scoped_lock l(mutex); data->progress = static_cast(progress) / total_bytes; if (data->abort) return; }