MCPcopy Create free account
hub / github.com/ReadyTalk/avian / Java_java_lang_Runtime_waitFor

Function Java_java_lang_Runtime_waitFor

classpath/java-lang.cpp:476–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474}
475
476extern "C" JNIEXPORT jint JNICALL
477 Java_java_lang_Runtime_waitFor(JNIEnv* e, jclass, jlong pid, jlong tid)
478{
479#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
480 DWORD exitCode;
481 WaitForSingleObject(reinterpret_cast<HANDLE>(pid), INFINITE);
482 BOOL success = GetExitCodeProcess(reinterpret_cast<HANDLE>(pid), &exitCode);
483 if (not success) {
484 throwNew(e, "java/lang/Exception", getErrorStr(GetLastError()));
485 }
486
487 CloseHandle(reinterpret_cast<HANDLE>(pid));
488 CloseHandle(reinterpret_cast<HANDLE>(tid));
489
490 return exitCode;
491#else
492 throwNew(e, "java/io/Exception", strdup("Not supported on WinRT/WinPhone8"));
493 return -1;
494#endif
495}
496
497extern "C" JNIEXPORT void JNICALL
498 Java_java_lang_Runtime_kill(JNIEnv* e UNUSED, jclass, jlong pid)

Callers

nothing calls this directly

Calls 2

getErrorStrFunction · 0.85
throwNewFunction · 0.70

Tested by

no test coverage detected