xref: /aosp_15_r20/external/grpc-grpc/src/python/grpcio/grpc/_cython/_cygrpc/fork_windows.pyx.pxi (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1# Copyright 2018 gRPC authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15
16# No-op implementations for Windows.
17
18def fork_handlers_and_grpc_init():
19    grpc_init()
20
21
22class ForkManagedThread(object):
23    def __init__(self, target, args=()):
24        self._thread = threading.Thread(target=_run_with_context(target), args=args)
25
26    def setDaemon(self, daemonic):
27        self._thread.daemon = daemonic
28
29    def start(self):
30        self._thread.start()
31
32    def join(self):
33        self._thread.join()
34
35
36def block_if_fork_in_progress(postfork_state_to_reset=None):
37    pass
38
39
40def enter_user_request_generator():
41    pass
42
43
44def return_from_user_request_generator():
45    pass
46
47
48def get_fork_epoch():
49    return 0
50
51
52def is_fork_support_enabled():
53    return False
54
55
56def fork_register_channel(channel):
57    pass
58
59
60def fork_unregister_channel(channel):
61    pass
62