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

Method RunInChild

cpp/src/arrow/util/atfork_test.cc:88–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87#ifndef _WIN32
88 void RunInChild(std::function<void()> func) {
89 auto child_pid = fork();
90 if (child_pid == -1) {
91 ASSERT_OK(IOErrorFromErrno(errno, "Error calling fork(): "));
92 }
93 if (child_pid == 0) {
94 // Child
95 ASSERT_NO_FATAL_FAILURE(func()) << "Failure in child process";
96 std::exit(0);
97 } else {
98 // Parent
99 AssertChildExit(child_pid);
100 }
101 }
102#endif
103
104 std::mutex mutex_;

Callers

nothing calls this directly

Calls 3

IOErrorFromErrnoFunction · 0.85
AssertChildExitFunction · 0.85
funcFunction · 0.50

Tested by

no test coverage detected