changeset 3095:8b55c8c3c7dd

. Make BSD changes to match the Linux/Solaris specific changes.
author Greg Lewis <glewis@eyesbeyond.com>
date Sun, 31 Oct 2010 17:57:38 -0700
parents 593aebeba3b7
children 64e91b4b5f48
files make/java/nio/mapfile-bsd src/solaris/classes/java/lang/UNIXProcess.java.bsd src/solaris/classes/sun/nio/fs/BsdFileStore.java
diffstat 3 files changed, 23 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/make/java/nio/mapfile-bsd	Sun Oct 31 14:18:51 2010 -0700
+++ b/make/java/nio/mapfile-bsd	Sun Oct 31 17:57:38 2010 -0700
@@ -70,7 +70,7 @@
                 Java_sun_nio_ch_IOUtil_drain;
                 Java_sun_nio_ch_IOUtil_fdVal;
                 Java_sun_nio_ch_IOUtil_initIDs;
-                Java_sun_nio_ch_IOUtil_initPipe;
+                Java_sun_nio_ch_IOUtil_makePipe;
                 Java_sun_nio_ch_IOUtil_randomBytes;
                 Java_sun_nio_ch_IOUtil_setfdVal;
 		Java_sun_nio_ch_NativeThread_current;
--- a/src/solaris/classes/java/lang/UNIXProcess.java.bsd	Sun Oct 31 14:18:51 2010 -0700
+++ b/src/solaris/classes/java/lang/UNIXProcess.java.bsd	Sun Oct 31 17:57:38 2010 -0700
@@ -39,6 +39,7 @@
 import java.util.concurrent.Executor;
 import java.util.concurrent.ThreadFactory;
 import java.security.AccessController;
+import static java.security.AccessController.doPrivileged;
 import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
@@ -94,14 +95,13 @@
         private final static ThreadGroup group = getRootThreadGroup();
 
         private static ThreadGroup getRootThreadGroup() {
-            return AccessController.doPrivileged
-            (new PrivilegedAction<ThreadGroup> () {
-            public ThreadGroup run() {
-                ThreadGroup root = Thread.currentThread().getThreadGroup();
-                while (root.getParent() != null)
-                    root = root.getParent();
-                return root;
-            }});
+            return doPrivileged(new PrivilegedAction<ThreadGroup> () {
+                public ThreadGroup run() {
+                    ThreadGroup root = Thread.currentThread().getThreadGroup();
+                    while (root.getParent() != null)
+                        root = root.getParent();
+                    return root;
+                }});
         }
 
         public Thread newThread(Runnable grimReaper) {
@@ -117,8 +117,12 @@
     /**
      * The thread pool of "process reaper" daemon threads.
      */
-    private static final Executor processReaperExecutor
-        = Executors.newCachedThreadPool(new ProcessReaperThreadFactory());
+    private static final Executor processReaperExecutor =
+        doPrivileged(new PrivilegedAction<Executor>() {
+            public Executor run() {
+                return Executors.newCachedThreadPool
+                    (new ProcessReaperThreadFactory());
+            }});
 
     UNIXProcess(final byte[] prog,
                 final byte[] argBlock, final int argc,
@@ -136,8 +140,7 @@
                           redirectErrorStream);
 
         try {
-            AccessController.doPrivileged
-            (new PrivilegedExceptionAction<Void>() {
+            doPrivileged(new PrivilegedExceptionAction<Void>() {
                 public Void run() throws IOException {
                     initStreams(fds);
                     return null;
@@ -173,7 +176,13 @@
             }});
     }
 
-    synchronized void processExited(int exitcode) {
+    void processExited(int exitcode) {
+        synchronized (this) {
+            this.exitcode = exitcode;
+            hasExited = true;
+            notifyAll();
+        }
+
         if (stdout instanceof ProcessPipeInputStream)
             ((ProcessPipeInputStream) stdout).processExited();
 
@@ -182,10 +191,6 @@
 
         if (stdin instanceof ProcessPipeOutputStream)
             ((ProcessPipeOutputStream) stdin).processExited();
-
-        this.exitcode = exitcode;
-        hasExited = true;
-        notifyAll();
     }
 
     public OutputStream getOutputStream() {
--- a/src/solaris/classes/sun/nio/fs/BsdFileStore.java	Sun Oct 31 14:18:51 2010 -0700
+++ b/src/solaris/classes/sun/nio/fs/BsdFileStore.java	Sun Oct 31 17:57:38 2010 -0700
@@ -157,9 +157,4 @@
 */
         return super.supportsFileAttributeView(name);
     }
-
-    @Override
-    boolean isLoopback() {
-        return false;
-    }
 }