aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/iomgr/endpoint_tests.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-12-28 15:44:25 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-12-28 15:44:25 -0800
commit91031dacb1ff5c57500307044b18c9f929134462 (patch)
tree129cd181da27264258804a2d99a9345ac7fde305 /test/core/iomgr/endpoint_tests.c
parentddebfa65f2bdff332902adf73606bc050014b498 (diff)
Changes to exec_ctx/closure/combiner/workqueue interfaces
- make closures know where they should be executed (eg, on a workqueue, or a combiner, or on an exec_ctx) - this allows removal of a large number of trampoline functions that were appearing whenever we used combiners, and should allow for a much easier interface to combiner locks
Diffstat (limited to 'test/core/iomgr/endpoint_tests.c')
-rw-r--r--test/core/iomgr/endpoint_tests.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/core/iomgr/endpoint_tests.c b/test/core/iomgr/endpoint_tests.c
index 8186ea7e85..87a9d79e9b 100644
--- a/test/core/iomgr/endpoint_tests.c
+++ b/test/core/iomgr/endpoint_tests.c
@@ -211,9 +211,10 @@ static void read_and_write_test(grpc_endpoint_test_config config,
state.write_done = 0;
state.current_read_data = 0;
state.current_write_data = 0;
- grpc_closure_init(&state.done_read, read_and_write_test_read_handler, &state);
+ grpc_closure_init(&state.done_read, read_and_write_test_read_handler, &state,
+ grpc_schedule_on_exec_ctx);
grpc_closure_init(&state.done_write, read_and_write_test_write_handler,
- &state);
+ &state, grpc_schedule_on_exec_ctx);
grpc_slice_buffer_init(&state.outgoing);
grpc_slice_buffer_init(&state.incoming);
@@ -290,16 +291,19 @@ static void multiple_shutdown_test(grpc_endpoint_test_config config) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_endpoint_add_to_pollset(&exec_ctx, f.client_ep, g_pollset);
grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer,
- grpc_closure_create(inc_on_failure, &fail_count));
+ grpc_closure_create(inc_on_failure, &fail_count,
+ grpc_schedule_on_exec_ctx));
wait_for_fail_count(&exec_ctx, &fail_count, 0);
grpc_endpoint_shutdown(&exec_ctx, f.client_ep);
wait_for_fail_count(&exec_ctx, &fail_count, 1);
grpc_endpoint_read(&exec_ctx, f.client_ep, &slice_buffer,
- grpc_closure_create(inc_on_failure, &fail_count));
+ grpc_closure_create(inc_on_failure, &fail_count,
+ grpc_schedule_on_exec_ctx));
wait_for_fail_count(&exec_ctx, &fail_count, 2);
grpc_slice_buffer_add(&slice_buffer, grpc_slice_from_copied_string("a"));
grpc_endpoint_write(&exec_ctx, f.client_ep, &slice_buffer,
- grpc_closure_create(inc_on_failure, &fail_count));
+ grpc_closure_create(inc_on_failure, &fail_count,
+ grpc_schedule_on_exec_ctx));
wait_for_fail_count(&exec_ctx, &fail_count, 3);
grpc_endpoint_shutdown(&exec_ctx, f.client_ep);
wait_for_fail_count(&exec_ctx, &fail_count, 3);