| 35 | namespace { |
| 36 | |
| 37 | bool 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). |
no test coverage detected