always unlock while waiting for disk-IO

This commit is contained in:
Arvid Norberg
2009-12-25 16:13:35 +00:00
parent ac8f64f5fe
commit ecb770eca7

View File

@@ -1783,8 +1783,10 @@ namespace libtorrent
{ {
if (cache_block(j, handler, l) < 0) if (cache_block(j, handler, l) < 0)
{ {
l.unlock();
file::iovec_t iov = {j.buffer, j.buffer_size}; file::iovec_t iov = {j.buffer, j.buffer_size};
ret = j.storage->write_impl(&iov, j.piece, j.offset, 1); ret = j.storage->write_impl(&iov, j.piece, j.offset, 1);
l.lock();
if (ret < 0) if (ret < 0)
{ {
test_error(j); test_error(j);