MCPcopy Create free account
hub / github.com/davisking/dlib / setup_interrupt_handler

Function setup_interrupt_handler

examples/slm_advanced_train_ex.cpp:431–442  ·  view source on GitHub ↗

Setup the interrupt handler based on platform

Source from the content-addressed store, hash-verified

429
430 // Setup the interrupt handler based on platform
431 void setup_interrupt_handler() {
432#ifdef _WIN32
433 if (!SetConsoleCtrlHandler(console_ctrl_handler, TRUE)) {
434 cerr << "ERROR: Could not set control handler" << endl;
435 }
436#else
437 struct sigaction sa {};
438 sigemptyset(&sa.sa_mask);
439 sa.sa_handler = signal_handler;
440 sigaction(SIGINT, &sa, NULL);
441#endif
442 }
443}
444
445// Utility function to get file size

Callers 1

mainFunction · 0.85

Calls 1

sigactionClass · 0.85

Tested by

no test coverage detected