MCPcopy Create free account
hub / github.com/Kitware/CMake / kwsysProcess_Kill

Function kwsysProcess_Kill

Source/kwsys/ProcessWin32.c:1436–1468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1434}
1435
1436void kwsysProcess_Kill(kwsysProcess* cp)
1437{
1438 int i;
1439 /* Make sure we are executing a process. */
1440 if (!cp || cp->State != kwsysProcess_State_Executing || cp->TimeoutExpired ||
1441 cp->Killed) {
1442 KWSYSPE_DEBUG((stderr, "kill: child not executing\n"));
1443 return;
1444 }
1445
1446 /* Disable the reading threads. */
1447 KWSYSPE_DEBUG((stderr, "kill: disabling pipe threads\n"));
1448 kwsysProcessDisablePipeThreads(cp);
1449
1450 /* Skip actually killing the child if it has already terminated. */
1451 if (cp->Terminated) {
1452 KWSYSPE_DEBUG((stderr, "kill: child already terminated\n"));
1453 return;
1454 }
1455
1456 /* Kill the children. */
1457 cp->Killed = 1;
1458 for (i = 0; i < cp->NumberOfCommands; ++i) {
1459 kwsysProcessKillTree(cp->ProcessInformation[i].dwProcessId);
1460 /* Remove from global list of processes and close handles. */
1461 kwsysProcessesRemove(cp->ProcessInformation[i].hProcess);
1462 kwsysProcessCleanupHandle(&cp->ProcessInformation[i].hThread);
1463 kwsysProcessCleanupHandle(&cp->ProcessInformation[i].hProcess);
1464 }
1465
1466 /* We are killing the children and ignoring all data. Do not wait
1467 for them to exit. */
1468}
1469
1470void kwsysProcess_KillPID(unsigned long process_id)
1471{

Callers 1

kwsysProcess_WaitForDataFunction · 0.70

Calls 4

kwsysProcessKillTreeFunction · 0.85
kwsysProcessesRemoveFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…