Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
z
Classes
Class List
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
grpc
src
core
lib
event_engine
forkable.h
Go to the documentation of this file.
1
// Copyright 2022 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
#ifndef GRPC_CORE_LIB_EVENT_ENGINE_FORKABLE_H
15
#define GRPC_CORE_LIB_EVENT_ENGINE_FORKABLE_H
16
17
#include <
grpc/support/port_platform.h
>
18
19
namespace
grpc_event_engine
{
20
namespace
experimental {
21
22
// Register fork handlers with the system, enabling fork support.
23
//
24
// This provides pthread-based support for fork events. Any objects that
25
// implement Forkable can register themselves with this system using
26
// ManageForkable, and their respective methods will be called upon fork.
27
//
28
// This should be called once upon grpc_initialization.
29
void
RegisterForkHandlers
();
30
31
// Global callback for pthread_atfork's *prepare argument
32
void
PrepareFork
();
33
// Global callback for pthread_atfork's *parent argument
34
void
PostforkParent
();
35
// Global callback for pthread_atfork's *child argument
36
void
PostforkChild
();
37
38
// An interface to be implemented by EventEngines that wish to have managed fork
39
// support.
40
class
Forkable
{
41
public
:
42
Forkable
();
43
virtual
~Forkable
();
44
virtual
void
PrepareFork
() = 0;
45
virtual
void
PostforkParent
() = 0;
46
virtual
void
PostforkChild
() = 0;
47
};
48
49
// Add Forkables from the set of objects that are supported.
50
// Upon fork, each forkable will have its respective fork hooks called on
51
// the thread that invoked the fork.
52
//
53
// Relative ordering of fork callback operations is not guaranteed.
54
void
ManageForkable
(
Forkable
* forkable);
55
// Remove a forkable from the managed set.
56
void
StopManagingForkable
(
Forkable
* forkable);
57
58
}
// namespace experimental
59
}
// namespace grpc_event_engine
60
61
#endif // GRPC_CORE_LIB_EVENT_ENGINE_FORKABLE_H
grpc_event_engine::experimental::RegisterForkHandlers
void RegisterForkHandlers()
Definition:
forkable.cc:90
grpc_event_engine::experimental::Forkable::~Forkable
virtual ~Forkable()
Definition:
forkable.cc:88
grpc_event_engine::experimental::PostforkChild
void PostforkChild()
Definition:
forkable.cc:93
grpc_event_engine::experimental::PostforkParent
void PostforkParent()
Definition:
forkable.cc:92
grpc_event_engine::experimental::StopManagingForkable
void StopManagingForkable(Forkable *)
Definition:
forkable.cc:96
grpc_event_engine::experimental::Forkable
Definition:
forkable.h:40
grpc_event_engine
Definition:
endpoint_config.h:24
grpc_event_engine::experimental::Forkable::PostforkChild
virtual void PostforkChild()=0
grpc_event_engine::experimental::PrepareFork
void PrepareFork()
Definition:
forkable.cc:91
grpc_event_engine::experimental::Forkable::PrepareFork
virtual void PrepareFork()=0
grpc_event_engine::experimental::Forkable::PostforkParent
virtual void PostforkParent()=0
grpc_event_engine::experimental::Forkable::Forkable
Forkable()
Definition:
forkable.cc:87
grpc_event_engine::experimental::ManageForkable
void ManageForkable(Forkable *)
Definition:
forkable.cc:95
port_platform.h
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:22