aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/iomgr.h
diff options
context:
space:
mode:
authorGravatar Guantao Liu <guantaol@google.com>2019-01-07 18:22:50 -0800
committerGravatar Guantao Liu <guantaol@google.com>2019-01-07 18:22:50 -0800
commit11eff929e24cae59ed21c2f3a0bde22a6dbe0d91 (patch)
tree7f540f95825292ef732f7e35a3e646c9dbf56c6c /src/core/lib/iomgr/iomgr.h
parent8dcda4dc36aa4e4d3a4c46023f6470b4c1ec7bca (diff)
Avoid the thread jump in server callback APIs.
Add a utility function in iomgr to check whether the caller thread is a worker for any background poller, and keep grpc combiner from offloading closures to the default executor if the current thread is a worker for any background poller.
Diffstat (limited to 'src/core/lib/iomgr/iomgr.h')
-rw-r--r--src/core/lib/iomgr/iomgr.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/iomgr.h b/src/core/lib/iomgr/iomgr.h
index 8ea9289e06..6261aa550c 100644
--- a/src/core/lib/iomgr/iomgr.h
+++ b/src/core/lib/iomgr/iomgr.h
@@ -39,6 +39,9 @@ void grpc_iomgr_shutdown();
* background poller. */
void grpc_iomgr_shutdown_background_closure();
+/** Returns true if the caller is a worker thread for any background poller. */
+bool grpc_iomgr_is_any_background_poller_thread();
+
/* Exposed only for testing */
size_t grpc_iomgr_count_objects_for_testing();