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

Function console_ctrl_handler

examples/slm_advanced_train_ex.cpp:412–419  ·  view source on GitHub ↗

Windows-specific handler

Source from the content-addressed store, hash-verified

410#ifdef _WIN32
411 // Windows-specific handler
412 BOOL WINAPI console_ctrl_handler(DWORD ctrl_type) {
413 if (ctrl_type == CTRL_C_EVENT) {
414 g_terminate_flag.store(true);
415 cout << "\nCtrl+C detected, cleaning up and closing the program..." << endl;
416 return TRUE;
417 }
418 return FALSE;
419 }
420#else
421 // Unix/Linux/macOS handler
422 void signal_handler(int signal) {

Callers

nothing calls this directly

Calls 1

storeMethod · 0.45

Tested by

no test coverage detected