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

Method AfterForkChild

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

Source from the content-addressed store, hash-verified

113 }
114
115 void AfterForkChild() {
116 // Need to reinitialize the mutex as it is probably invalid. Also, the
117 // old mutex destructor may fail.
118 // Fortunately, we are a single thread in the child process by now, so no
119 // additional synchronization is needed.
120 new (&mutex_) std::mutex;
121
122 auto handlers = std::move(handlers_while_forking_);
123 handlers_while_forking_.clear();
124
125 // Execute handlers in reverse order
126 for (auto it = handlers.rbegin(); it != handlers.rend(); ++it) {
127 auto&& handler = *it;
128 if (handler.handler->child_after) {
129 handler.handler->child_after(std::move(handler.token));
130 }
131 }
132 }
133
134 void RegisterAtFork(std::weak_ptr<AtForkHandler> weak_handler) {
135 std::lock_guard<std::mutex> lock(mutex_);

Callers 1

GetAtForkStateFunction · 0.80

Calls 3

rbeginMethod · 0.80
rendMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected