MCPcopy Create free account
hub / github.com/apache/arrow / GetAtForkState

Function GetAtForkState

cpp/src/arrow/util/atfork_internal.cc:147–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145};
146
147AtForkState* GetAtForkState() {
148 static std::unique_ptr<AtForkState> state = []() {
149 auto state = std::make_unique<AtForkState>();
150#ifndef _WIN32
151 int r = pthread_atfork(/*prepare=*/[] { GetAtForkState()->BeforeFork(); },
152 /*parent=*/[] { GetAtForkState()->AfterForkParent(); },
153 /*child=*/[] { GetAtForkState()->AfterForkChild(); });
154 if (r != 0) {
155 IOErrorFromErrno(r, "Error when calling pthread_atfork: ").Abort();
156 }
157#endif
158 return state;
159 }();
160 return state.get();
161}
162
163}; // namespace
164

Callers 1

RegisterAtForkFunction · 0.85

Calls 6

IOErrorFromErrnoFunction · 0.85
AfterForkParentMethod · 0.80
AfterForkChildMethod · 0.80
BeforeForkMethod · 0.45
AbortMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected