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

Function kwsysTryEnterCreateProcessSection

Source/kwsys/ProcessWin32.c:2626–2638  ·  view source on GitHub ↗

The Ctrl handler waits on the global list of processes. To prevent an orphaned process, do not create a new process if the Ctrl handler is already running. Do so by using this function to check if it is ok to create a process. */

Source from the content-addressed store, hash-verified

2624 already running. Do so by using this function to check if it is ok to
2625 create a process. */
2626static int kwsysTryEnterCreateProcessSection(void)
2627{
2628 /* Enter main critical section; this means creating a process and the Ctrl
2629 handler are mutually exclusive. */
2630 EnterCriticalSection(&kwsysProcesses.Lock);
2631 /* Indicate to the caller if they can create a process. */
2632 if (kwsysProcesses.Exiting) {
2633 LeaveCriticalSection(&kwsysProcesses.Lock);
2634 return 0;
2635 } else {
2636 return 1;
2637 }
2638}
2639
2640/* Matching function on successful kwsysTryEnterCreateProcessSection return.
2641 Make sure you called kwsysProcessesAdd if applicable before calling this.*/

Callers 1

kwsysProcessCreateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…