From f85873263b930d5c8c3bb07859375c904fc4de7d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 3 Oct 2007 17:40:18 +0000 Subject: [PATCH] fixed possible race condition in debug mode --- src/torrent.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/torrent.cpp b/src/torrent.cpp index 14fa6f5e9..35abc2c49 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -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 num_requests; for (const_peer_iterator i = begin(); i != end(); ++i)