assert that offset didn't change while hashing
This commit is contained in:
parent
f36b9a805a
commit
cf7db392b6
|
@ -2155,6 +2155,9 @@ namespace libtorrent
|
|||
|
||||
// save a local copy of offset to avoid concurrent access
|
||||
int offset = ph->offset;
|
||||
#if TORRENT_USE_ASSERTS
|
||||
int old_offset = offset;
|
||||
#endif
|
||||
|
||||
l.unlock();
|
||||
|
||||
|
@ -2172,6 +2175,7 @@ namespace libtorrent
|
|||
|
||||
l.lock();
|
||||
|
||||
TORRENT_ASSERT(old_offset == ph->offset);
|
||||
ph->offset = offset;
|
||||
|
||||
TORRENT_PIECE_ASSERT(pe->hashing, pe);
|
||||
|
@ -2395,6 +2399,9 @@ namespace libtorrent
|
|||
|
||||
// save a local copy of offset to avoid concurrent access
|
||||
int offset = ph->offset;
|
||||
#if TORRENT_USE_ASSERTS
|
||||
int old_offset = offset;
|
||||
#endif
|
||||
|
||||
l.unlock();
|
||||
|
||||
|
@ -2494,6 +2501,7 @@ namespace libtorrent
|
|||
|
||||
l.lock();
|
||||
|
||||
TORRENT_ASSERT(old_offset == ph->offset);
|
||||
ph->offset = offset;
|
||||
|
||||
// decrement the refcounts of the blocks we just hashed
|
||||
|
|
Loading…
Reference in New Issue