fixed threading problem in file_pool
This commit is contained in:
@@ -45,6 +45,7 @@ namespace libtorrent
|
||||
{
|
||||
assert(st != 0);
|
||||
assert(p.is_complete());
|
||||
boost::mutex::scoped_lock l(m_mutex);
|
||||
typedef nth_index<file_set, 0>::type path_view;
|
||||
path_view& pt = get<0>(m_files);
|
||||
path_view::iterator i = pt.find(p);
|
||||
@@ -93,6 +94,7 @@ namespace libtorrent
|
||||
|
||||
void file_pool::release(void* st)
|
||||
{
|
||||
boost::mutex::scoped_lock l(m_mutex);
|
||||
assert(st != 0);
|
||||
using boost::tie;
|
||||
|
||||
@@ -108,6 +110,7 @@ namespace libtorrent
|
||||
{
|
||||
assert(size > 0);
|
||||
if (size == m_size) return;
|
||||
boost::mutex::scoped_lock l(m_mutex);
|
||||
m_size = size;
|
||||
if (int(m_files.size()) <= m_size) return;
|
||||
|
||||
|
Reference in New Issue
Block a user