szaszm commented on code in PR #2151:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2151#discussion_r3016787023


##########
extensions/aws/utils/AWSInitializer.cpp:
##########
@@ -34,6 +34,12 @@ AWSInitializer& AWSInitializer::get() {
 }
 
 AWSInitializer::~AWSInitializer() {
+  shutdown();
+}
+
+void AWSInitializer::shutdown() {
+  if (is_shut_down_) return;
+  is_shut_down_ = true;

Review Comment:
   I think this initializer can be used concurrently from multiple threads, so 
this needs to be thread-safe. I think changing the flag to an atomic bool and 
making this change should be sufficient.
   ```suggestion
     bool is_shut_down = false;
     if (!is_shut_down_.compare_exchange_strong(&is_shut_down, true)) return;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to