Description of changes: When using AmazonS3EncryptionClientV2 in multi-threaded environment, it fails to store UploadPartEncryptionContext of a multipart upload, because by default Dictionary isn't a thread safe data structure in C#.
There exists ConcurrentDictionary which is available on all target framework except net35. Therefore, I added custom ConcurrentDictionary which includes all the basic operations that are being used in the code at the moment.
Testing:: Able to multipart upload in multiple threads using AmazonS3EncryptionClientV2.
Note: All threads are working on separate input streams.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: None
Description of changes: When using
AmazonS3EncryptionClientV2
in multi-threaded environment, it fails to storeUploadPartEncryptionContext
of a multipart upload, because by defaultDictionary
isn't a thread safe data structure in C#.There exists ConcurrentDictionary which is available on all target framework except
net35
. Therefore, I added customConcurrentDictionary
which includes all the basic operations that are being used in the code at the moment.Testing:: Able to multipart upload in multiple threads using
AmazonS3EncryptionClientV2
.Note: All threads are working on separate input streams.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.