VMAccessController.java (pushContext, [...]): Use Thread.currentThread() to determine...
authorGary Benson <gbenson@redhat.com>
Mon, 7 Aug 2006 14:14:14 +0000 (14:14 +0000)
committerGary Benson <gary@gcc.gnu.org>
Mon, 7 Aug 2006 14:14:14 +0000 (14:14 +0000)
2006-08-07  Gary Benson  <gbenson@redhat.com>

* java/security/VMAccessController.java (pushContext, popContext,
getContext): Use Thread.currentThread() to determine when we're
bootstrapping.
(runtimeInitialized): Remove.
* java/security/natVMAccessController.cc (runtimeInitialized):
Remove.

From-SVN: r115996

libjava/ChangeLog
libjava/java/security/VMAccessController.java
libjava/java/security/natVMAccessController.cc

index 57044e81a897a2a5a233c5f2b0a0d23cd40ca88f..5b8d467f6a5a5f2dc110242f6f10cecec8d03ef8 100644 (file)
@@ -1,3 +1,12 @@
+2006-08-07  Gary Benson  <gbenson@redhat.com>
+
+       * java/security/VMAccessController.java (pushContext, popContext,
+       getContext): Use Thread.currentThread() to determine when we're
+       bootstrapping.
+       (runtimeInitialized): Remove.
+       * java/security/natVMAccessController.cc (runtimeInitialized):
+       Remove.
+
 2006-08-06  Tom Tromey  <tromey@redhat.com>
 
        PR libgcj/28491:
index dfbd16f693b4377e15b83de7fbce81fc8e30e37a..c39475334bb46de728b260a4fe6ff8e22eec703e 100644 (file)
@@ -103,7 +103,7 @@ final class VMAccessController
    */
   static void pushContext (AccessControlContext acc)
   {
-    if (!runtimeInitialized())
+    if (Thread.currentThread() == null)
       return;
 
     if (DEBUG)
@@ -127,7 +127,7 @@ final class VMAccessController
    */
   static void popContext()
   {
-    if (!runtimeInitialized())
+    if (Thread.currentThread() == null)
       return;
 
     if (DEBUG)
@@ -161,7 +161,7 @@ final class VMAccessController
     // so that any security checks succeed.
     //
     // XXX this might not be necessary, but it seems prudent.
-    if (!runtimeInitialized())
+    if (Thread.currentThread() == null)
       return DEFAULT_CONTEXT;
 
     // If we are already in getContext, but called a method that needs
@@ -284,11 +284,4 @@ final class VMAccessController
    *    of Strings comprising the method names.
    */
   private static native Object[][] getStack();
-
-  /**
-   * Tell whether runtime initialization is complete.
-   *
-   * @return whether runtime initialization is complete.
-   */
-  private static native boolean runtimeInitialized();
 }
index 255034532848e7b60ff7ed29de3f55d6c86c7e7a..e56ccbd9135ecb2f70f665be16258fcdb61504c7 100644 (file)
@@ -22,9 +22,3 @@ java::security::VMAccessController::getStack ()
   _Jv_StackTrace *trace = _Jv_StackTrace::GetStackTrace ();
   return _Jv_StackTrace::GetClassMethodStack (trace);
 }
-
-jboolean
-java::security::VMAccessController::runtimeInitialized ()
-{
-  return gcj::runtimeInitialized;
-}