joemarshall commented on code in PR #35672:
URL: https://github.com/apache/arrow/pull/35672#discussion_r1239677898


##########
cpp/src/arrow/util/thread_pool.h:
##########
@@ -194,6 +196,11 @@ class ARROW_EXPORT Executor {
   // Executor. Returns false if this Executor does not support this property.
   virtual bool OwnsThisThread() { return false; }
 
+  // Return true if this is the current executor being called
+  // n.b. this defaults to just calling OwnsThisThread
+  // unless the threadpool is disabled
+  virtual bool IsCurrentExecutor() { return OwnsThisThread(); }

Review Comment:
   It's because in threading disabled mode, there can be multiple nested 
executors running, with one executor waiting on another. OwnsThisThread assumes 
that each executor has a thread, and uses the thread id to check if the code is 
running under one particular executor, which doesn't work without threads.



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