fixed possible race condition in debug mode

This commit is contained in:
Arvid Norberg 2007-10-03 17:40:18 +00:00
parent 4cab49cbdf
commit f85873263b
1 changed files with 2 additions and 0 deletions

View File

@ -2397,6 +2397,8 @@ namespace libtorrent
#ifndef NDEBUG
void torrent::check_invariant() const
{
session_impl::mutex_t::scoped_lock l(m_ses.m_mutex);
int num_uploads = 0;
std::map<piece_block, int> num_requests;
for (const_peer_iterator i = begin(); i != end(); ++i)