MCPcopy Create free account
hub / github.com/crownengine/crown / wait

Method wait

src/core/process.cpp:211–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211s32 Process::wait()
212{
213 CE_ENSURE(process_internal::is_open(_priv) == true);
214
215#if CROWN_PLATFORM_WINDOWS
216 DWORD exitcode = 1;
217 ::WaitForSingleObject(_priv->process.hProcess, INFINITE);
218 GetExitCodeProcess(_priv->process.hProcess, &exitcode);
219 CloseHandle(_priv->process.hProcess);
220 CloseHandle(_priv->process.hThread);
221 memset(&_priv->process, 0, sizeof(_priv->process));
222 return (s32)exitcode;
223#else
224 pid_t pid;
225 int wstatus;
226
227 if (_priv->file != NULL) {
228 fclose(_priv->file);
229 _priv->file = NULL;
230 }
231
232 do {
233 pid = waitpid(_priv->pid, &wstatus, 0);
234 } while (pid == -1 && errno == EINTR);
235
236 _priv->pid = -1;
237 return WIFEXITED(wstatus) ? (s32)WEXITSTATUS(wstatus) : -1;
238#endif // if CROWN_PLATFORM_WINDOWS
239}
240
241char *Process::read(u32 *num_bytes_read, char *data, u32 len)
242{

Callers 12

main_internalFunction · 0.45
compileFunction · 0.45
wait_shaderc_processFunction · 0.45
compile_bgfx_shaderMethod · 0.45
runMethod · 0.45
compileFunction · 0.45
compile_internalMethod · 0.45
listenMethod · 0.45
run_input_threadMethod · 0.45
run_output_threadMethod · 0.45
runMethod · 0.45

Calls 3

is_openFunction · 0.85
memsetFunction · 0.85
fcloseFunction · 0.85

Tested by

no test coverage detected