You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/03/17 09:16:27 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #9720: ARROW-11976: [C++] Fix sporadic TSAN error with GatingTask

pitrou commented on a change in pull request #9720:
URL: https://github.com/apache/arrow/pull/9720#discussion_r595837013



##########
File path: cpp/src/arrow/testing/gtest_util.cc
##########
@@ -769,10 +770,8 @@ class GatingTask::Impl {
   }
 
   Status Unlock() {
-    {
-      std::lock_guard<std::mutex> lk(mx_);
-      unlocked_ = true;
-    }
+    std::lock_guard<std::mutex> lk(mx_);

Review comment:
       Indeed, but this is a test util so I'd favor simplicity.

##########
File path: cpp/src/arrow/testing/gtest_util.cc
##########
@@ -769,10 +770,8 @@ class GatingTask::Impl {
   }
 
   Status Unlock() {
-    {
-      std::lock_guard<std::mutex> lk(mx_);
-      unlocked_ = true;
-    }
+    std::lock_guard<std::mutex> lk(mx_);

Review comment:
       Indeed, but this is a test utility so I'd favor simplicity.




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

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