You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "icexelloss (via GitHub)" <gi...@apache.org> on 2023/02/05 15:08:54 UTC

[GitHub] [arrow] icexelloss commented on a diff in pull request #34042: GH-33850: [C++] Allow Substrait's default extension provider to be configured

icexelloss commented on code in PR #34042:
URL: https://github.com/apache/arrow/pull/34042#discussion_r1096718632


##########
cpp/src/arrow/engine/substrait/options.cc:
##########
@@ -122,11 +122,23 @@ class DefaultExtensionProvider : public BaseExtensionProvider {
   }
 };
 
-std::shared_ptr<ExtensionProvider> ExtensionProvider::kDefaultExtensionProvider =
+namespace {
+
+std::shared_ptr<ExtensionProvider> kDefaultExtensionProvider =
     std::make_shared<DefaultExtensionProvider>();
 
+std::mutex kDefaultExtensionProviderMutex;
+
+}  // namespace
+
 std::shared_ptr<ExtensionProvider> default_extension_provider() {
-  return ExtensionProvider::kDefaultExtensionProvider;
+  std::unique_lock<std::mutex> lock(kDefaultExtensionProviderMutex);

Review Comment:
   Don't think we need the lock here - IMO this method doesn't need to be thread safe (I cannot imagine who would want to do this in multi threaded way)



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org