fixed race condition in invariant check in disk io thread (only affected debug builds)

This commit is contained in:
Arvid Norberg 2008-09-30 01:16:19 +00:00
parent 195521db65
commit 0f6ec06e12
1 changed files with 2 additions and 1 deletions

View File

@ -636,10 +636,11 @@ namespace libtorrent
TORRENT_ASSERT(j.buffer_size <= m_block_size);
mutex_t::scoped_lock l(m_queue_mutex);
#ifndef NDEBUG
mutex_t::scoped_lock l2(m_piece_mutex);
if (j.action == disk_io_job::write)
{
cache_t::iterator p
= find_cached_piece(m_pieces, j, l);
= find_cached_piece(m_pieces, j, l2);
if (p != m_pieces.end())
{
int block = j.offset / m_block_size;