MCPcopy Create free account
hub / github.com/amule-project/amule / HasPendingHashWork

Method HasPendingHashWork

src/PartFile.cpp:2553–2575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2551
2552
2553bool CPartFile::HasPendingHashWork() const
2554{
2555 if (m_iWrites > 0) {
2556 return false;
2557 }
2558 for (bool dirty : m_aChangedPart) {
2559 if (dirty) {
2560 return true;
2561 }
2562 }
2563 // Completion-pending: gaplist is closed and the file is in active
2564 // state but writes haven't all been harvested yet — keep firing
2565 // FlushBuffer at Process tick rate so the trailing CompleteFile
2566 // check runs once the worker thread drains. Without this, a slow
2567 // worker that completes the gap-closing write after the last
2568 // FlushBuffer would leave us waiting for BUFFER_TIME_LIMIT (60 s).
2569 if (m_gaplist.IsComplete()
2570 && (status == PS_EMPTY || status == PS_READY)
2571 && !m_BufferedData_list.empty()) {
2572 return true;
2573 }
2574 return false;
2575}
2576
2577
2578void CPartFile::StopFile(bool bCancel)

Callers 1

ProcessMethod · 0.80

Calls 2

IsCompleteMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected