pitrou commented on code in PR #36418:
URL: https://github.com/apache/arrow/pull/36418#discussion_r1252056977


##########
cpp/src/arrow/array/array_dict.cc:
##########
@@ -106,8 +106,9 @@ DictionaryArray::DictionaryArray(const 
std::shared_ptr<DataType>& type,
   SetData(data);
 }
 
-std::shared_ptr<Array> DictionaryArray::dictionary() const {
+const std::shared_ptr<Array>& DictionaryArray::dictionary() const {
   if (!dictionary_) {
+    // FIXME this isn't thread safe

Review Comment:
   Or use https://en.cppreference.com/w/cpp/memory/shared_ptr/atomic



-- 
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