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

Function kwsysProcessesRemove

Source/kwsys/ProcessWin32.c:2705–2737  ·  view source on GitHub ↗

Removes process to global process list. */

Source from the content-addressed store, hash-verified

2703
2704/* Removes process to global process list. */
2705static void kwsysProcessesRemove(HANDLE hProcess)
2706{
2707 size_t i;
2708
2709 if (!hProcess || hProcess == INVALID_HANDLE_VALUE) {
2710 return;
2711 }
2712
2713 EnterCriticalSection(&kwsysProcesses.Lock);
2714
2715 /* Find the given process in the set. */
2716 for (i = 0; i < kwsysProcesses.Count; ++i) {
2717 if (kwsysProcesses.Processes[i].hProcess == hProcess) {
2718 break;
2719 }
2720 }
2721 if (i < kwsysProcesses.Count) {
2722 /* Found it! Remove the process from the set. */
2723 --kwsysProcesses.Count;
2724 for (; i < kwsysProcesses.Count; ++i) {
2725 kwsysProcesses.Processes[i] = kwsysProcesses.Processes[i + 1];
2726 }
2727
2728 /* If this was the last process, free the array. */
2729 if (kwsysProcesses.Count == 0) {
2730 kwsysProcesses.Size = 0;
2731 free(kwsysProcesses.Processes);
2732 kwsysProcesses.Processes = 0;
2733 }
2734 }
2735
2736 LeaveCriticalSection(&kwsysProcesses.Lock);
2737}
2738
2739static BOOL WINAPI kwsysCtrlHandler(DWORD dwCtrlType)
2740{

Callers 3

kwsysProcess_KillFunction · 0.70
kwsysProcessDestroyFunction · 0.70
kwsysProcessCleanupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…