3 * Copyright 2018 gRPC authors.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 #include <grpc/support/port_platform.h>
21 #include "src/core/lib/iomgr/pollset.h"
23 grpc_pollset_vtable* grpc_pollset_impl;
25 void grpc_set_pollset_vtable(grpc_pollset_vtable* vtable) {
26 grpc_pollset_impl = vtable;
29 void grpc_pollset_global_init() { grpc_pollset_impl->global_init(); }
31 void grpc_pollset_global_shutdown() { grpc_pollset_impl->global_shutdown(); }
33 void grpc_pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
34 grpc_pollset_impl->init(pollset, mu);
37 void grpc_pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
38 grpc_pollset_impl->shutdown(pollset, closure);
41 void grpc_pollset_destroy(grpc_pollset* pollset) {
42 grpc_pollset_impl->destroy(pollset);
45 grpc_error* grpc_pollset_work(grpc_pollset* pollset,
46 grpc_pollset_worker** worker,
47 grpc_millis deadline) {
48 return grpc_pollset_impl->work(pollset, worker, deadline);
51 grpc_error* grpc_pollset_kick(grpc_pollset* pollset,
52 grpc_pollset_worker* specific_worker) {
53 return grpc_pollset_impl->kick(pollset, specific_worker);
56 size_t grpc_pollset_size(void) { return grpc_pollset_impl->pollset_size(); }