summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libtorrent/src/file_pool.cpp3
-rwxr-xr-xlibtorrent/src/session_impl.cpp1
2 files changed, 2 insertions, 2 deletions
diff --git a/libtorrent/src/file_pool.cpp b/libtorrent/src/file_pool.cpp
index 865c071ff..ef7ccca0d 100644
--- a/libtorrent/src/file_pool.cpp
+++ b/libtorrent/src/file_pool.cpp
@@ -57,7 +57,8 @@ namespace libtorrent
lru_file_entry e = *i;
e.last_use = time_now();
- if (e.key != st)
+ if (e.key != st && ((e.mode & file::rw_mask) != file::read_only
+ || (m & file::rw_mask) != file::read_only))
{
// this means that another instance of the storage
// is using the exact same file.
diff --git a/libtorrent/src/session_impl.cpp b/libtorrent/src/session_impl.cpp
index 5596b7fef..4ccf35066 100755
--- a/libtorrent/src/session_impl.cpp
+++ b/libtorrent/src/session_impl.cpp
@@ -2163,7 +2163,6 @@ namespace aux {
mutex_t::scoped_lock l(m_mutex);
if (m_dht) e = m_dht->state();
done = true;
- l.unlock();
c.notify_all();
}