Skip to content

Commit 8e7ab3e

Browse files
committed
fix
1 parent c6c5d36 commit 8e7ab3e

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

sdk/storage/azure-storage-common/src/concurrent_transfer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ namespace Azure { namespace Storage { namespace _internal {
99

1010
int GetHardwareConcurrency()
1111
{
12-
static int c = std::thread::hardware_concurrency();
12+
static int c = static_cast<int>(std::thread::hardware_concurrency());
1313
return c;
1414
}
1515

16-
}}} // namespace Azure::Storage::_internal
16+
}}} // namespace Azure::Storage::_internal

sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,8 +1401,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
14011401
/**
14021402
* The maximum number of threads that may be used in a parallel transfer.
14031403
*/
1404-
int32_t Concurrency
1405-
= _internal::GetHardwareConcurrency() != 0 ? _internal::GetHardwareConcurrency() : 1;
1404+
int32_t Concurrency = (std::min)(96, (std::max)(8, _internal::GetHardwareConcurrency()));
14061405
} TransferOptions;
14071406
};
14081407

0 commit comments

Comments
 (0)