• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  * Copyright 2018 gRPC authors.
4  *
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
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  */
18 
19 #include <grpc/support/port_platform.h>
20 
21 #include "src/core/lib/iomgr/pollset.h"
22 
23 grpc_pollset_vtable* grpc_pollset_impl;
24 
grpc_set_pollset_vtable(grpc_pollset_vtable * vtable)25 void grpc_set_pollset_vtable(grpc_pollset_vtable* vtable) {
26   grpc_pollset_impl = vtable;
27 }
28 
grpc_pollset_global_init()29 void grpc_pollset_global_init() { grpc_pollset_impl->global_init(); }
30 
grpc_pollset_global_shutdown()31 void grpc_pollset_global_shutdown() { grpc_pollset_impl->global_shutdown(); }
32 
grpc_pollset_init(grpc_pollset * pollset,gpr_mu ** mu)33 void grpc_pollset_init(grpc_pollset* pollset, gpr_mu** mu) {
34   grpc_pollset_impl->init(pollset, mu);
35 }
36 
grpc_pollset_shutdown(grpc_pollset * pollset,grpc_closure * closure)37 void grpc_pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) {
38   grpc_pollset_impl->shutdown(pollset, closure);
39 }
40 
grpc_pollset_destroy(grpc_pollset * pollset)41 void grpc_pollset_destroy(grpc_pollset* pollset) {
42   grpc_pollset_impl->destroy(pollset);
43 }
44 
grpc_pollset_work(grpc_pollset * pollset,grpc_pollset_worker ** worker,grpc_millis deadline)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);
49 }
50 
grpc_pollset_kick(grpc_pollset * pollset,grpc_pollset_worker * specific_worker)51 grpc_error* grpc_pollset_kick(grpc_pollset* pollset,
52                               grpc_pollset_worker* specific_worker) {
53   return grpc_pollset_impl->kick(pollset, specific_worker);
54 }
55 
grpc_pollset_size(void)56 size_t grpc_pollset_size(void) { return grpc_pollset_impl->pollset_size(); }
57