| 1031 | class EndpointProviderCache { |
| 1032 | public: |
| 1033 | std::shared_ptr<Aws::S3::S3EndpointProviderBase> Lookup( |
| 1034 | const Aws::S3::S3ClientConfiguration& config) { |
| 1035 | auto key = EndpointConfigKey(config); |
| 1036 | CacheValue* value; |
| 1037 | { |
| 1038 | std::unique_lock lock(mutex_); |
| 1039 | value = &cache_[std::move(key)]; |
| 1040 | } |
| 1041 | std::call_once(value->once, [&]() { |
| 1042 | auto endpoint_provider = std::make_shared<Aws::S3::S3EndpointProvider>(); |
| 1043 | endpoint_provider->InitBuiltInParameters(config); |
| 1044 | value->endpoint_provider = |
| 1045 | std::make_shared<InitOnceEndpointProvider>(std::move(endpoint_provider)); |
| 1046 | }); |
| 1047 | return value->endpoint_provider; |
| 1048 | } |
| 1049 | |
| 1050 | void Reset() { |
| 1051 | std::unique_lock lock(mutex_); |
no test coverage detected