Index: src/libchcore/TLocalFilesystemFile.cpp =================================================================== diff -u -rd468098a278a0d16c5b700236ea276b9c9677c9f -rf49b990b02af82798b59d35fec2374d23c6bb053 --- src/libchcore/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision d468098a278a0d16c5b700236ea276b9c9677c9f) +++ src/libchcore/TLocalFilesystemFile.cpp (.../TLocalFilesystemFile.cpp) (revision f49b990b02af82798b59d35fec2374d23c6bb053) @@ -152,7 +152,7 @@ if (!IsOpen()) THROW_FILE_EXCEPTION(eErr_FileNotOpen, ERROR_INVALID_HANDLE, m_pathFile, L"Cannot read from closed file"); - ATLTRACE(_T("Reading %lu bytes\n"), rBuffer.GetRequestedDataSize()); + //ATLTRACE(_T("Reading %lu bytes\n"), rBuffer.GetRequestedDataSize()); if (!::ReadFileEx(m_hFile, rBuffer.GetBufferPtr(), rBuffer.GetRequestedDataSize(), &rBuffer, OverlappedReadCompleted)) { DWORD dwLastError = GetLastError(); @@ -188,7 +188,7 @@ if (m_bNoBuffering && rBuffer.IsLastPart()) dwToWrite = RoundUp(dwToWrite, MaxSectorSize); - ATLTRACE(_T("Writing %lu bytes\n"), dwToWrite); + //ATLTRACE(_T("Writing %lu bytes\n"), dwToWrite); if (!::WriteFileEx(m_hFile, rBuffer.GetBufferPtr(), dwToWrite, &rBuffer, OverlappedWriteCompleted)) { DWORD dwLastError = GetLastError(); @@ -207,13 +207,13 @@ DWORD dwToWrite = boost::numeric_cast(rBuffer.GetRealDataSize()); DWORD dwReallyWritten = RoundUp(dwToWrite, MaxSectorSize); - ATLTRACE(_T("Finalize file - size diff: written: %I64u, required: %I64u\n"), dwReallyWritten, dwToWrite); + //ATLTRACE(_T("Finalize file - size diff: written: %I64u, required: %I64u\n"), dwReallyWritten, dwToWrite); if (dwToWrite != dwReallyWritten) { file_size_t fsNewFileSize = rBuffer.GetFilePosition() + dwToWrite; // new size //seek - ATLTRACE(_T("Truncating file to %I64u bytes\n"), fsNewFileSize); + //ATLTRACE(_T("Truncating file to %I64u bytes\n"), fsNewFileSize); Truncate(fsNewFileSize); } } Index: src/libchcore/TTaskManager.cpp =================================================================== diff -u -rba618764ec3c9221fa704e905a9f807bd85ed4c5 -rf49b990b02af82798b59d35fec2374d23c6bb053 --- src/libchcore/TTaskManager.cpp (.../TTaskManager.cpp) (revision ba618764ec3c9221fa704e905a9f807bd85ed4c5) +++ src/libchcore/TTaskManager.cpp (.../TTaskManager.cpp) (revision f49b990b02af82798b59d35fec2374d23c6bb053) @@ -230,10 +230,11 @@ boost::shared_lock lock(m_lock); size_t stTasksToRun = stMaxRunningTasks == 0 ? std::numeric_limits::max() : stMaxRunningTasks; - stTasksToRun -= stRunningCount; - if (stTasksToRun > 0) + if (stRunningCount < stTasksToRun) { + stTasksToRun -= stRunningCount; + for (size_t stIndex = 0; stIndex < m_tTasks.GetCount(); ++stIndex) { TTaskInfoEntry& rEntry = m_tTasks.GetAt(stIndex);