diff options
author | Guantao Liu <guantaol@google.com> | 2019-01-07 18:22:50 -0800 |
---|---|---|
committer | Guantao Liu <guantaol@google.com> | 2019-01-07 18:22:50 -0800 |
commit | 11eff929e24cae59ed21c2f3a0bde22a6dbe0d91 (patch) | |
tree | 7f540f95825292ef732f7e35a3e646c9dbf56c6c /src/core/lib/iomgr/iomgr_internal.cc | |
parent | 8dcda4dc36aa4e4d3a4c46023f6470b4c1ec7bca (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_internal.cc')
-rw-r--r-- | src/core/lib/iomgr/iomgr_internal.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/iomgr_internal.cc b/src/core/lib/iomgr/iomgr_internal.cc index b6c9211865..e68b1cf581 100644 --- a/src/core/lib/iomgr/iomgr_internal.cc +++ b/src/core/lib/iomgr/iomgr_internal.cc @@ -45,3 +45,7 @@ void grpc_iomgr_platform_shutdown() { iomgr_platform_vtable->shutdown(); } void grpc_iomgr_platform_shutdown_background_closure() { iomgr_platform_vtable->shutdown_background_closure(); } + +bool grpc_iomgr_platform_is_any_background_poller_thread() { + return iomgr_platform_vtable->is_any_background_poller_thread(); +} |