This commit is contained in:
kssenii 2023-02-16 21:23:03 +01:00
parent 730ac4de93
commit 0bceb5957a
2 changed files with 2 additions and 2 deletions

View File

@ -469,7 +469,7 @@ bool FileSegment::reserve(size_t size_to_reserve)
/// No lock is required because reserved size is always
/// mananaged (read/modified) by the downloader only
/// or in isLastHolder() case.
/// Therefore, atomic must not be used, it will only hide possible races.
/// It is made atomic because of getInfoForLog.
reserved_size += size_to_reserve;
}
}

View File

@ -318,7 +318,7 @@ private:
/// downloaded_size should always be less or equal to reserved_size
std::atomic<size_t> downloaded_size = 0;
size_t reserved_size = 0;
std::atomic<size_t> reserved_size = 0;
/// global locking order rule:
/// 1. cache lock