diff --git a/include/libtorrent/bandwidth_manager.hpp b/include/libtorrent/bandwidth_manager.hpp index b34f4b993..b64e575bd 100644 --- a/include/libtorrent/bandwidth_manager.hpp +++ b/include/libtorrent/bandwidth_manager.hpp @@ -154,7 +154,6 @@ struct bandwidth_manager bool is_queued(PeerConnection const* peer, boost::mutex::scoped_lock& l) const { - TORRENT_ASSERT(l.locked()); for (typename queue_t::const_iterator i = m_queue.begin() , end(m_queue.end()); i != end; ++i) { @@ -171,7 +170,6 @@ struct bandwidth_manager bool is_in_history(PeerConnection const* peer, boost::mutex::scoped_lock& l) const { - TORRENT_ASSERT(l.locked()); for (typename history_t::const_iterator i = m_history.begin(), end(m_history.end()); i != end; ++i) { @@ -313,7 +311,6 @@ private: void hand_out_bandwidth(boost::mutex::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); // if we're already handing out bandwidth, just return back // to the loop further down on the callstack if (m_in_hand_out_bandwidth) return; diff --git a/src/disk_io_thread.cpp b/src/disk_io_thread.cpp index ecb18b6de..ac76263ce 100644 --- a/src/disk_io_thread.cpp +++ b/src/disk_io_thread.cpp @@ -182,7 +182,6 @@ namespace libtorrent disk_io_thread::cache_t& cache , disk_io_job const& j, mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); for (cache_t::iterator i = cache.begin() , end(cache.end()); i != end; ++i) { @@ -196,7 +195,6 @@ namespace libtorrent { ptime now = time_now(); - TORRENT_ASSERT(l.locked()); INVARIANT_CHECK; for (;;) { @@ -213,7 +211,6 @@ namespace libtorrent void disk_io_thread::free_piece(cached_piece_entry& p, mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); int piece_size = p.storage->info()->piece_size(p.piece); int blocks_in_piece = (piece_size + m_block_size - 1) / m_block_size; @@ -251,7 +248,6 @@ namespace libtorrent void disk_io_thread::flush_oldest_piece(mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); INVARIANT_CHECK; // first look if there are any read cache entries that can // be cleared @@ -275,7 +271,6 @@ namespace libtorrent void disk_io_thread::flush(disk_io_thread::cache_t::iterator e , mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); INVARIANT_CHECK; cached_piece_entry& p = *e; int piece_size = p.storage->info()->piece_size(p.piece); @@ -340,7 +335,6 @@ namespace libtorrent void disk_io_thread::cache_block(disk_io_job& j, mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); INVARIANT_CHECK; TORRENT_ASSERT(find_cached_piece(m_pieces, j, l) == m_pieces.end()); cached_piece_entry p; @@ -365,8 +359,6 @@ namespace libtorrent // read or -1 if there was an error int disk_io_thread::read_into_piece(cached_piece_entry& p, int start_block, mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); - int piece_size = p.storage->info()->piece_size(p.piece); int blocks_in_piece = (piece_size + m_block_size - 1) / m_block_size; @@ -436,8 +428,6 @@ namespace libtorrent , cache_t::iterator ignore , mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); - if (m_cache_size - m_cache_stats.cache_size < num_blocks) { // there's not enough room in the cache, clear a piece @@ -452,8 +442,6 @@ namespace libtorrent // or the number of bytes read int disk_io_thread::cache_read_block(disk_io_job const& j, mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); - INVARIANT_CHECK; int piece_size = j.storage->info()->piece_size(j.piece); @@ -543,7 +531,6 @@ namespace libtorrent int disk_io_thread::try_read_from_cache(disk_io_job const& j, mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); TORRENT_ASSERT(j.buffer); if (!m_use_read_cache) return -2; @@ -707,7 +694,6 @@ namespace libtorrent char* disk_io_thread::allocate_buffer(mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); #ifdef TORRENT_STATS ++m_allocations; #endif @@ -720,7 +706,6 @@ namespace libtorrent void disk_io_thread::free_buffer(char* buf, mutex_t::scoped_lock& l) { - TORRENT_ASSERT(l.locked()); #ifdef TORRENT_STATS --m_allocations; #endif diff --git a/src/mapped_storage.cpp b/src/mapped_storage.cpp index bb1380d88..567a281b9 100644 --- a/src/mapped_storage.cpp +++ b/src/mapped_storage.cpp @@ -57,8 +57,8 @@ using boost::iostreams::mapped_file_params; namespace libtorrent { - namespace fs = boost::filesystem; + using boost::system::error_code; struct mapped_file_pool { @@ -78,7 +78,7 @@ namespace libtorrent #ifndef NDEBUG if (file_size > 0) { - fs::system_error_type ec; + error_code ec; fs::file_status st = fs::status(path, ec); TORRENT_ASSERT(!fs::exists(st)); } @@ -197,7 +197,7 @@ namespace libtorrent size_type start = (offset / view_size) * view_size; TORRENT_ASSERT(start + view_size >= offset + length); - fs::system_error_type ec; + error_code ec; fs::file_status st = fs::status(p, ec); m_files.push_back(file_entry());