MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / sigint_handler

Function sigint_handler

smallthinker/tools/main/main.cpp:66–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64
65#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) || defined (_WIN32)
66static void sigint_handler(int signo) {
67 if (signo == SIGINT) {
68 if (!is_interacting && g_params->interactive) {
69 is_interacting = true;
70 need_insert_eot = true;
71 } else {
72 console::cleanup();
73 LOG("\n");
74 common_perf_print(*g_ctx, *g_smpl);
75
76 // make sure all logs are flushed
77 LOG("Interrupted by user\n");
78 common_log_pause(common_log_main());
79
80 _exit(130);
81 }
82 }
83}
84#endif
85
86int main(int argc, char ** argv) {

Callers 1

mainFunction · 0.70

Calls 4

common_perf_printFunction · 0.85
common_log_pauseFunction · 0.85
common_log_mainFunction · 0.85
cleanupFunction · 0.50

Tested by

no test coverage detected