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

Function IsAtForkEnabled

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

Source from the content-addressed store, hash-verified

35namespace {
36
37bool IsAtForkEnabled() {
38 static bool is_enabled = [] {
39 auto maybe_value =
40 GetEnvVarInteger("ARROW_REGISTER_ATFORK", /*min_value=*/0, /*max_value=*/1);
41 if (maybe_value.ok()) {
42 return *maybe_value != 0;
43 }
44 if (!maybe_value.status().IsKeyError()) {
45 maybe_value.status().Warn();
46 }
47 // Enabled by default
48 return true;
49 }();
50 return is_enabled;
51}
52
53// Singleton state for at-fork management.
54// We do not use global variables because of initialization order issues (ARROW-18383).

Callers 1

RegisterAtForkFunction · 0.85

Calls 4

GetEnvVarIntegerFunction · 0.85
WarnMethod · 0.80
okMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected