| 1175 | } |
| 1176 | |
| 1177 | void kwsysProcess_Disown(kwsysProcess* cp) |
| 1178 | { |
| 1179 | int i; |
| 1180 | |
| 1181 | /* Make sure we are executing a detached process. */ |
| 1182 | if (!cp || !cp->Detached || cp->State != kwsysProcess_State_Executing || |
| 1183 | cp->TimeoutExpired || cp->Killed || cp->Terminated) { |
| 1184 | return; |
| 1185 | } |
| 1186 | |
| 1187 | /* Disable the reading threads. */ |
| 1188 | kwsysProcessDisablePipeThreads(cp); |
| 1189 | |
| 1190 | /* Wait for all pipe threads to reset. */ |
| 1191 | for (i = 0; i < KWSYSPE_PIPE_COUNT; ++i) { |
| 1192 | WaitForSingleObject(cp->Pipe[i].Reader.Reset, INFINITE); |
| 1193 | WaitForSingleObject(cp->Pipe[i].Waker.Reset, INFINITE); |
| 1194 | } |
| 1195 | |
| 1196 | /* We will not wait for exit, so cleanup now. */ |
| 1197 | kwsysProcessCleanup(cp, 0); |
| 1198 | |
| 1199 | /* The process has been disowned. */ |
| 1200 | cp->State = kwsysProcess_State_Disowned; |
| 1201 | } |
| 1202 | |
| 1203 | int kwsysProcess_WaitForData(kwsysProcess* cp, char** data, int* length, |
| 1204 | double* userTimeout) |
no test coverage detected
searching dependent graphs…