Create App context callback for timer custom

When a timer reaches its deadline and it uses the combination of having
enabled the custom timer and using a completion queue of callback type we
must provide the App context callback at TLS level. Otherwise, a segfault
is produced during the enqueuing process of the application callback.
pull/18898/head
Pau Freixes 6 years ago
parent 8fe1abebbf
commit 884b68c984
  1. 1
      src/core/lib/iomgr/timer_custom.cc

@ -32,6 +32,7 @@ static grpc_custom_timer_vtable* custom_timer_impl;
void grpc_custom_timer_callback(grpc_custom_timer* t, grpc_error* error) {
GRPC_CUSTOM_IOMGR_ASSERT_SAME_THREAD();
grpc_core::ApplicationCallbackExecCtx callback_exec_ctx;
grpc_core::ExecCtx exec_ctx;
grpc_timer* timer = t->original;
GPR_ASSERT(timer->pending);

Loading…
Cancel
Save