| 73 | bool SignalStopSourceEnabled() { return stop_source_ != nullptr; } |
| 74 | |
| 75 | void EnableSignalStopSource() { |
| 76 | // Try to set up the stop source. If another library linking to |
| 77 | // the same libarrow shared object has already done this, this call |
| 78 | // will fail (which is OK, we just don't get the ability to cancel) |
| 79 | if (!SignalStopSourceEnabled()) { |
| 80 | auto maybe_stop_source = arrow::SetSignalStopSource(); |
| 81 | if (maybe_stop_source.ok()) { |
| 82 | stop_source_ = maybe_stop_source.ValueUnsafe(); |
| 83 | } else { |
| 84 | cpp11::warning("Failed to enable user cancellation: %s", |
| 85 | maybe_stop_source.status().message().c_str()); |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | void DisableSignalStopSource() { |
| 91 | if (SignalStopSourceEnabled()) { |
no test coverage detected