src/windows/classes/java/lang/ProcessImpl.java

Print this page

        

@@ -455,12 +455,14 @@
     public void destroy() { terminateProcess(handle); }
     private static native void terminateProcess(long handle);
 
     /**
      * Create a process using the win32 function CreateProcess.
+     * The method is synchronized due to MS kb315939 problem.
+     * All native handles should restore the inherit flag at the end of call.
      *
-     * @param cmdstr the Windows commandline
+     * @param cmdstr the Windows command line
      * @param envblock NUL-separated, double-NUL-terminated list of
      *        environment strings in VAR=VALUE form
      * @param dir the working directory of the process, or null if
      *        inheriting the current directory from the parent process
      * @param stdHandles array of windows HANDLEs.  Indexes 0, 1, and

@@ -472,11 +474,11 @@
      *        been created.  An element of this array is -1 on input
      *        if and only if it is <em>not</em> -1 on output.
      * @param redirectErrorStream redirectErrorStream attribute
      * @return the native subprocess HANDLE returned by CreateProcess
      */
-    private static native long create(String cmdstr,
+    private static synchronized native long create(String cmdstr,
                                       String envblock,
                                       String dir,
                                       long[] stdHandles,
                                       boolean redirectErrorStream)
         throws IOException;