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

Method AfterForkParent

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

Source from the content-addressed store, hash-verified

95 }
96
97 void AfterForkParent() {
98 // The mutex was locked by BeforeFork()
99 auto handlers = std::move(handlers_while_forking_);
100 handlers_while_forking_.clear();
101
102 // Execute handlers in reverse order
103 for (auto it = handlers.rbegin(); it != handlers.rend(); ++it) {
104 auto&& handler = *it;
105 if (handler.handler->parent_after) {
106 handler.handler->parent_after(std::move(handler.token));
107 }
108 }
109
110 mutex_.unlock();
111 // handlers will be destroyed here without the mutex locked, so that
112 // any action taken by destructors might call RegisterAtFork
113 }
114
115 void AfterForkChild() {
116 // Need to reinitialize the mutex as it is probably invalid. Also, the

Callers 1

GetAtForkStateFunction · 0.80

Calls 3

rbeginMethod · 0.80
rendMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected