14#ifndef ORTOOLS_UTIL_SIGINT_H_
15#define ORTOOLS_UTIL_SIGINT_H_
22#if ORTOOLS_TARGET_OS_SUPPORTS_THREADS
28 SigintHandler() =
default;
33 void Register(
const std::function<
void()>& f);
36 std::atomic<int> num_calls_ = 0;
38 static void SigHandler(
int s);
39 thread_local static std::function<void()> handler_;
44 SigtermHandler() =
default;
49 void Register(
const std::function<
void()>& f);
52 static void SigHandler(
int s);
53 thread_local static std::function<void()> handler_;