MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / waitProcess

Function waitProcess

Common/helper_multiprocess.cpp:152–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152int waitProcess(Process *process) {
153#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
154 DWORD exitCode;
155 WaitForSingleObject(process->hProcess, INFINITE);
156 GetExitCodeProcess(process->hProcess, &exitCode);
157 CloseHandle(process->hProcess);
158 CloseHandle(process->hThread);
159 return (int)exitCode;
160#else
161 int status = 0;
162 do {
163 if (0 > waitpid(*process, &status, 0)) {
164 return errno;
165 }
166 } while (!WIFEXITED(status));
167 return WEXITSTATUS(status);
168#endif
169}
170
171#if defined(__linux__) || defined(__QNX__)
172int ipcCreateSocket(ipcHandle *&handle, const char *name,

Callers 1

parentProcessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected