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. */
| 2624 | already running. Do so by using this function to check if it is ok to |
| 2625 | create a process. */ |
| 2626 | static 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.*/ |
no outgoing calls
no test coverage detected
searching dependent graphs…