removed potential cross-lock situation (reported by Valgrind)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3855 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2010-11-22 21:15:21 +00:00
parent 34a3fc4ea8
commit d83a7118fa

View File

@ -255,15 +255,19 @@ void ftController::run()
tickTransfers() ;
{
std::list<std::string> files_to_complete ;
{
RsStackMutex stack2(doneMutex);
for(std::list<std::string>::iterator it(mDone.begin()); it != mDone.end(); it++)
completeFile(*it);
files_to_complete = mDone ;
mDone.clear();
}
for(std::list<std::string>::iterator it(files_to_complete.begin()); it != files_to_complete.end(); ++it)
completeFile(*it);
}
if(cnt++ % 10 == 0)
checkDownloadQueue() ;
}