diff options
author | Laszlo Csomor <laszlocsomor@google.com> | 2017-01-19 12:17:26 +0000 |
---|---|---|
committer | Vladimir Moskva <vladmos@google.com> | 2017-01-19 12:37:06 +0000 |
commit | e5f4f92f0765a89d76e800071ef851f51679ee3e (patch) | |
tree | a364d6fa2c5a6bdb4ca61eaa3030fee1f69de2cc /src/main/native/windows_processes.cc | |
parent | 97f4ac65a553ca30f3a8535e66fe04ef7ff79a7b (diff) |
Windows JNI: refactorings
In this change:
- rename //src/main/native:windows_jni_utils to
//src/main/native:windows_jni_lib and make it
visible to //src/main/cpp:__subpackages__ because
we will use some methods there from this library
- move AutoHandle into windows_util.h, we'll use
it from blaze_util_windows.cc / file_windows.cc
later
See https://github.com/bazelbuild/bazel/issues/2107
--
PiperOrigin-RevId: 144946842
MOS_MIGRATED_REVID=144946842
Diffstat (limited to 'src/main/native/windows_processes.cc')
-rw-r--r-- | src/main/native/windows_processes.cc | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/main/native/windows_processes.cc b/src/main/native/windows_processes.cc index 97f22b48be..284b4e8c60 100644 --- a/src/main/native/windows_processes.cc +++ b/src/main/native/windows_processes.cc @@ -79,16 +79,6 @@ struct NativeProcess { error_("") {} }; -struct AutoHandle { - AutoHandle() : handle(INVALID_HANDLE_VALUE) {} - ~AutoHandle() { - CloseHandle(handle); // handles INVALID_HANDLE_VALUE - handle = INVALID_HANDLE_VALUE; - } - - HANDLE handle; -}; - class JavaByteArray { public: JavaByteArray(JNIEnv* env, jbyteArray java_array) @@ -196,10 +186,10 @@ Java_com_google_devtools_build_lib_windows_WindowsProcesses_nativeCreateProcess( // created. If this was not so, operations on these file handles would not // return immediately if the process is terminated. // Therefore we make these handles auto-closing (by using AutoHandle). - AutoHandle stdin_process; - AutoHandle stdout_process; - AutoHandle stderr_process; - AutoHandle thread; + windows_util::AutoHandle stdin_process; + windows_util::AutoHandle stdout_process; + windows_util::AutoHandle stderr_process; + windows_util::AutoHandle thread; PROCESS_INFORMATION process_info = {0}; STARTUPINFOA startup_info = {0}; JOBOBJECT_EXTENDED_LIMIT_INFORMATION job_info = {0}; |