MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / sendInterrupt

Method sendInterrupt

MiniZincIDE/process.cpp:90–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void Process::sendInterrupt()
91{
92 if (state() == QProcess::NotRunning) {
93 return;
94 }
95#ifdef Q_OS_WIN
96 QString pipe;
97 QTextStream ts(&pipe);
98 ts << "\\\\.\\pipe\\minizinc-" << processId();
99 auto pipeName = pipe.toStdString();
100 HANDLE hNamedPipe = CreateFileA(pipeName.c_str(), GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
101 if (hNamedPipe != INVALID_HANDLE_VALUE) {
102 DWORD bytesWritten;
103 WriteFile(hNamedPipe, nullptr, 0, &bytesWritten, nullptr);
104 CloseHandle(hNamedPipe);
105 }
106#else
107 ::killpg(processId(), SIGINT);
108#endif
109}
110
111#if QT_VERSION >= 0x060000
112void Process::setpgid()

Callers 1

stopMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected